From 7ef76acd21845c0dc0c0e8a3932b23f3e03f4e93 Mon Sep 17 00:00:00 2001 From: leventov Date: Fri, 7 Oct 2016 02:40:09 +0300 Subject: [PATCH 1/5] Add Checkstyle framework --- codestyle/checkstyle-suppressions.xml | 28 +++++++++++++++++++++ codestyle/checkstyle.xml | 35 +++++++++++++++++++++++++++ pom.xml | 24 ++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 codestyle/checkstyle-suppressions.xml create mode 100644 codestyle/checkstyle.xml diff --git a/codestyle/checkstyle-suppressions.xml b/codestyle/checkstyle-suppressions.xml new file mode 100644 index 000000000000..82fea852b1e0 --- /dev/null +++ b/codestyle/checkstyle-suppressions.xml @@ -0,0 +1,28 @@ + + + + + + + + + \ No newline at end of file diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml new file mode 100644 index 000000000000..124de04c4113 --- /dev/null +++ b/codestyle/checkstyle.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 4b73edf0d638..e4fcb66d4b10 100644 --- a/pom.xml +++ b/pom.xml @@ -685,6 +685,30 @@ coveralls-maven-plugin 4.0.0 + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.17 + + ${project.build.sourceDirectory} + true + codestyle/checkstyle.xml + codestyle/checkstyle-suppressions.xml + checkstyle.suppressions.file + UTF-8 + true + true + + + + validate + validate + + check + + + + From a5842bfa8e6670710b98711c5c99342dfce518a5 Mon Sep 17 00:00:00 2001 From: leventov Date: Fri, 7 Oct 2016 14:41:22 +0300 Subject: [PATCH 2/5] Avoid star import --- codestyle/checkstyle.xml | 2 +- .../firehose/rocketmq/RocketMQFirehoseFactory.java | 11 +++++++++-- .../data/input/orc/OrcHadoopInputRowParserTest.java | 8 +++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml index 124de04c4113..4f33bf013a8f 100644 --- a/codestyle/checkstyle.xml +++ b/codestyle/checkstyle.xml @@ -30,6 +30,6 @@ - + \ No newline at end of file diff --git a/extensions-contrib/druid-rocketmq/src/main/java/io/druid/firehose/rocketmq/RocketMQFirehoseFactory.java b/extensions-contrib/druid-rocketmq/src/main/java/io/druid/firehose/rocketmq/RocketMQFirehoseFactory.java index f3dcce46dd0b..37eea84129df 100644 --- a/extensions-contrib/druid-rocketmq/src/main/java/io/druid/firehose/rocketmq/RocketMQFirehoseFactory.java +++ b/extensions-contrib/druid-rocketmq/src/main/java/io/druid/firehose/rocketmq/RocketMQFirehoseFactory.java @@ -34,16 +34,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Sets; +import com.metamx.common.logger.Logger; import com.metamx.common.parsers.ParseException; import io.druid.data.input.ByteBufferInputRowParser; import io.druid.data.input.Firehose; import io.druid.data.input.FirehoseFactory; import io.druid.data.input.InputRow; -import com.metamx.common.logger.Logger; import java.io.IOException; import java.nio.ByteBuffer; -import java.util.*; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentSkipListSet; import java.util.concurrent.CountDownLatch; diff --git a/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcHadoopInputRowParserTest.java b/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcHadoopInputRowParserTest.java index cc473f4829bc..15dee8564544 100644 --- a/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcHadoopInputRowParserTest.java +++ b/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcHadoopInputRowParserTest.java @@ -25,7 +25,13 @@ import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.name.Names; -import io.druid.data.input.impl.*; +import io.druid.data.input.impl.DimensionSchema; +import io.druid.data.input.impl.DimensionsSpec; +import io.druid.data.input.impl.InputRowParser; +import io.druid.data.input.impl.ParseSpec; +import io.druid.data.input.impl.StringDimensionSchema; +import io.druid.data.input.impl.TimeAndDimsParseSpec; +import io.druid.data.input.impl.TimestampSpec; import io.druid.guice.GuiceInjectors; import io.druid.initialization.Initialization; import io.druid.jackson.DefaultObjectMapper; From 24ed008903979b89f9a67ed85e088bbe411a660a Mon Sep 17 00:00:00 2001 From: leventov Date: Fri, 7 Oct 2016 18:48:35 +0300 Subject: [PATCH 3/5] Need braces for control flow statements --- codestyle/checkstyle.xml | 1 + .../io/druid/storage/azure/AzureTaskLogs.java | 4 +- .../input/orc/OrcHadoopInputRowParser.java | 9 ++- .../server/lookup/LoadingLookupFactory.java | 4 +- .../s3/AWSSessionCredentialsAdapter.java | 5 +- .../druid/granularity/PeriodGranularity.java | 60 +++++++++++++------ .../DoubleMaxAggregatorFactory.java | 16 +++-- .../DoubleMinAggregatorFactory.java | 16 +++-- .../io/druid/query/aggregation/Histogram.java | 40 +++++++++---- .../HistogramBufferAggregator.java | 8 ++- .../query/aggregation/HistogramVisual.java | 12 +++- .../aggregation/LongMaxAggregatorFactory.java | 16 +++-- .../aggregation/LongMinAggregatorFactory.java | 16 +++-- .../HyperUniquesAggregatorFactory.java | 16 +++-- .../post/FieldAccessPostAggregator.java | 16 +++-- .../query/dimension/DefaultDimensionSpec.java | 16 +++-- .../dimension/ExtractionDimensionSpec.java | 19 ++++-- .../druid/query/search/SearchQueryRunner.java | 6 +- .../query/search/search/SearchQuery.java | 36 ++++++++--- .../io/druid/query/select/SelectQuery.java | 32 +++++++--- .../spec/MultipleIntervalSegmentSpec.java | 12 +++- .../spec/MultipleSpecificSegmentSpec.java | 16 +++-- .../druid/query/spec/SpecificSegmentSpec.java | 12 +++- .../query/timeseries/TimeseriesQuery.java | 26 +++++--- .../query/topn/NumericTopNMetricSpec.java | 12 +++- .../java/io/druid/query/topn/TopNQuery.java | 36 +++++++---- .../data/input/ProtoTestEventWrapper.java | 12 +++- .../query/aggregation/HistogramTest.java | 4 +- .../HyperLogLogCollectorBenchmark.java | 4 +- .../server/coordinator/rules/LoadRule.java | 9 ++- 30 files changed, 361 insertions(+), 130 deletions(-) diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml index 4f33bf013a8f..0f6538ef7be6 100644 --- a/codestyle/checkstyle.xml +++ b/codestyle/checkstyle.xml @@ -31,5 +31,6 @@ + \ No newline at end of file diff --git a/extensions-contrib/azure-extensions/src/main/java/io/druid/storage/azure/AzureTaskLogs.java b/extensions-contrib/azure-extensions/src/main/java/io/druid/storage/azure/AzureTaskLogs.java index 71b9757e9956..714f0f416f75 100644 --- a/extensions-contrib/azure-extensions/src/main/java/io/druid/storage/azure/AzureTaskLogs.java +++ b/extensions-contrib/azure-extensions/src/main/java/io/druid/storage/azure/AzureTaskLogs.java @@ -73,7 +73,9 @@ public Optional streamTaskLog(final String taskid, final long offset final String taskKey = getTaskLogKey(taskid); try { - if (!azureStorage.getBlobExists(container, taskKey)) return Optional.absent(); + if (!azureStorage.getBlobExists(container, taskKey)) { + return Optional.absent(); + } return Optional.of( new ByteSource() { diff --git a/extensions-contrib/orc-extensions/src/main/java/io/druid/data/input/orc/OrcHadoopInputRowParser.java b/extensions-contrib/orc-extensions/src/main/java/io/druid/data/input/orc/OrcHadoopInputRowParser.java index 3040504a007d..fca7f51030a3 100644 --- a/extensions-contrib/orc-extensions/src/main/java/io/druid/data/input/orc/OrcHadoopInputRowParser.java +++ b/extensions-contrib/orc-extensions/src/main/java/io/druid/data/input/orc/OrcHadoopInputRowParser.java @@ -199,16 +199,19 @@ public String apply(@Nullable TypeInfo typeInfo) { @Override public boolean equals(Object o) { - if (!(o instanceof OrcHadoopInputRowParser)) + if (!(o instanceof OrcHadoopInputRowParser)) { return false; + } OrcHadoopInputRowParser other = (OrcHadoopInputRowParser)o; - if (!parseSpec.equals(other.parseSpec)) + if (!parseSpec.equals(other.parseSpec)) { return false; + } - if (!typeString.equals(other.typeString)) + if (!typeString.equals(other.typeString)) { return false; + } return true; } diff --git a/extensions-core/lookups-cached-single/src/main/java/io/druid/server/lookup/LoadingLookupFactory.java b/extensions-core/lookups-cached-single/src/main/java/io/druid/server/lookup/LoadingLookupFactory.java index 5a9648789854..bb6aba8ea5ed 100644 --- a/extensions-core/lookups-cached-single/src/main/java/io/druid/server/lookup/LoadingLookupFactory.java +++ b/extensions-core/lookups-cached-single/src/main/java/io/druid/server/lookup/LoadingLookupFactory.java @@ -96,7 +96,9 @@ public boolean replaces( @Nullable LookupExtractorFactory lookupExtractorFactory ) { - if (lookupExtractorFactory == null) return true; + if (lookupExtractorFactory == null) { + return true; + } return !this.equals(lookupExtractorFactory); } diff --git a/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/AWSSessionCredentialsAdapter.java b/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/AWSSessionCredentialsAdapter.java index 70bb8427421c..d5bc25677fc9 100644 --- a/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/AWSSessionCredentialsAdapter.java +++ b/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/AWSSessionCredentialsAdapter.java @@ -27,10 +27,11 @@ public class AWSSessionCredentialsAdapter extends AWSSessionCredentials { public AWSSessionCredentialsAdapter(AWSCredentialsProvider provider) { super(null, null, null); - if(provider.getCredentials() instanceof com.amazonaws.auth.AWSSessionCredentials) + if(provider.getCredentials() instanceof com.amazonaws.auth.AWSSessionCredentials) { this.provider = provider; - else + } else { throw new IllegalArgumentException("provider does not contain session credentials"); + } } @Override diff --git a/processing/src/main/java/io/druid/granularity/PeriodGranularity.java b/processing/src/main/java/io/druid/granularity/PeriodGranularity.java index 1834e50f35c4..91239c04cfd0 100644 --- a/processing/src/main/java/io/druid/granularity/PeriodGranularity.java +++ b/processing/src/main/java/io/druid/granularity/PeriodGranularity.java @@ -111,8 +111,11 @@ public long truncate(long t) y -= y % years; long tt = chronology.years().add(origin, y); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.years().add(tt, -years); - else t = tt; + if(t < tt) { + t = chronology.years().add(tt, -years); + } else { + t = tt; + } return t; } else @@ -130,8 +133,11 @@ public long truncate(long t) m -= m % months; long tt = chronology.months().add(origin, m); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.months().add(tt, -months); - else t = tt; + if(t < tt) { + t = chronology.months().add(tt, -months); + } else { + t = tt; + } return t; } else @@ -150,8 +156,11 @@ public long truncate(long t) w -= w % weeks; long tt = chronology.weeks().add(origin, w); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.weeks().add(tt, -weeks); - else t = tt; + if(t < tt) { + t = chronology.weeks().add(tt, -weeks); + } else { + t = tt; + } return t; } else @@ -172,8 +181,11 @@ public long truncate(long t) d -= d % days; long tt = chronology.days().add(origin, d); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.days().add(tt, -days); - else t = tt; + if(t < tt) { + t = chronology.days().add(tt, -days); + } else { + t = tt; + } return t; } else @@ -193,8 +205,11 @@ public long truncate(long t) h -= h % hours; long tt = chronology.hours().add(origin, h); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.hours().add(tt, -hours); - else t = tt; + if(t < tt) { + t = chronology.hours().add(tt, -hours); + } else { + t = tt; + } return t; } else @@ -214,8 +229,11 @@ public long truncate(long t) m -= m % minutes; long tt = chronology.minutes().add(origin, m); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.minutes().add(tt, -minutes); - else t = tt; + if(t < tt) { + t = chronology.minutes().add(tt, -minutes); + } else { + t = tt; + } return t; } else @@ -235,8 +253,11 @@ public long truncate(long t) s -= s % seconds; long tt = chronology.seconds().add(origin, s); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.seconds().add(tt, -seconds); - else t = tt; + if(t < tt) { + t = chronology.seconds().add(tt, -seconds); + } else { + t = tt; + } return t; } else @@ -254,8 +275,11 @@ public long truncate(long t) ms -= ms % millis; long tt = chronology.millis().add(origin, ms); // always round down to the previous period (for timestamps prior to origin) - if(t < tt) t = chronology.millis().add(tt, -millis); - else t = tt; + if(t < tt) { + t = chronology.millis().add(tt, -millis); + } else { + t = tt; + } return t; } else { @@ -274,7 +298,9 @@ private static boolean isCompoundPeriod(Period period) { if(v > 0) { - if(single) return true; + if(single) { + return true; + } single = true; } } diff --git a/processing/src/main/java/io/druid/query/aggregation/DoubleMaxAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/DoubleMaxAggregatorFactory.java index 029bc86afafb..7918711ff482 100644 --- a/processing/src/main/java/io/druid/query/aggregation/DoubleMaxAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/DoubleMaxAggregatorFactory.java @@ -172,13 +172,21 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } DoubleMaxAggregatorFactory that = (DoubleMaxAggregatorFactory) o; - if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) return false; - if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) { + return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/aggregation/DoubleMinAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/DoubleMinAggregatorFactory.java index 04f1de0ede39..8ed5036177bc 100644 --- a/processing/src/main/java/io/druid/query/aggregation/DoubleMinAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/DoubleMinAggregatorFactory.java @@ -172,13 +172,21 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } DoubleMinAggregatorFactory that = (DoubleMinAggregatorFactory) o; - if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) return false; - if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) { + return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/aggregation/Histogram.java b/processing/src/main/java/io/druid/query/aggregation/Histogram.java index 40689ceb2b49..b77d2607f70d 100644 --- a/processing/src/main/java/io/druid/query/aggregation/Histogram.java +++ b/processing/src/main/java/io/druid/query/aggregation/Histogram.java @@ -51,12 +51,18 @@ public Histogram(float[] breaks, long[] bins, float min, float max) { this.bins = bins; this.min = min; this.max = max; - for(long k : bins) this.count += k; + for(long k : bins) { + this.count += k; + } } public void offer(float d) { - if(d > max) max = d; - if(d < min) min = d; + if(d > max) { + max = d; + } + if(d < min) { + min = d; + } int index = Arrays.binarySearch(breaks, d); int pos = (index >= 0) ? index : -(index + 1); @@ -67,8 +73,12 @@ public void offer(float d) { public Histogram fold(Histogram h) { Preconditions.checkArgument(Arrays.equals(breaks, h.breaks), "Cannot fold histograms with different breaks"); - if(h.min < min) min = h.min; - if(h.max > max) max = h.max; + if(h.min < min) { + min = h.min; + } + if(h.max > max) { + max = h.max; + } count += h.count; for (int i = 0; i < bins.length; ++i) { @@ -124,8 +134,12 @@ public byte[] toBytes() { Longs.BYTES * bins.length + Floats.BYTES * 2); buf.putInt(breaks.length); - for(float b : breaks) buf.putFloat(b); - for(long c : bins ) buf.putLong(c); + for(float b : breaks) { + buf.putFloat(b); + } + for(long c : bins ) { + buf.putLong(c); + } buf.putFloat(min); buf.putFloat(max); @@ -141,7 +155,9 @@ public byte[] toBytes() { */ public HistogramVisual asVisual() { float[] visualCounts = new float[bins.length - 2]; - for(int i = 0; i < visualCounts.length; ++i) visualCounts[i] = (float)bins[i + 1]; + for(int i = 0; i < visualCounts.length; ++i) { + visualCounts[i] = (float) bins[i + 1]; + } return new HistogramVisual(breaks, visualCounts, new float[]{min, max}); } @@ -155,8 +171,12 @@ public static Histogram fromBytes(ByteBuffer buf) { float[] breaks = new float[n]; long[] bins = new long[n + 1]; - for (int i = 0; i < breaks.length; ++i) breaks[i] = buf.getFloat(); - for (int i = 0; i < bins.length ; ++i) bins[i] = buf.getLong(); + for (int i = 0; i < breaks.length; ++i) { + breaks[i] = buf.getFloat(); + } + for (int i = 0; i < bins.length ; ++i) { + bins[i] = buf.getLong(); + } float min = buf.getFloat(); float max = buf.getFloat(); diff --git a/processing/src/main/java/io/druid/query/aggregation/HistogramBufferAggregator.java b/processing/src/main/java/io/druid/query/aggregation/HistogramBufferAggregator.java index d41244e4c66a..8ad856c33abb 100644 --- a/processing/src/main/java/io/druid/query/aggregation/HistogramBufferAggregator.java +++ b/processing/src/main/java/io/druid/query/aggregation/HistogramBufferAggregator.java @@ -60,8 +60,12 @@ public void aggregate(ByteBuffer buf, int position) final int minPos = position + minOffset; final int maxPos = position + maxOffset; - if(value < buf.getFloat(minPos)) buf.putFloat(minPos, value); - if(value > buf.getFloat(maxPos)) buf.putFloat(maxPos, value); + if(value < buf.getFloat(minPos)) { + buf.putFloat(minPos, value); + } + if(value > buf.getFloat(maxPos)) { + buf.putFloat(maxPos, value); + } int index = Arrays.binarySearch(breaks, value); index = (index >= 0) ? index : -(index + 1); diff --git a/processing/src/main/java/io/druid/query/aggregation/HistogramVisual.java b/processing/src/main/java/io/druid/query/aggregation/HistogramVisual.java index 3310096f8a76..0f7cf5949726 100644 --- a/processing/src/main/java/io/druid/query/aggregation/HistogramVisual.java +++ b/processing/src/main/java/io/druid/query/aggregation/HistogramVisual.java @@ -62,9 +62,15 @@ public HistogramVisual( this.breaks = new double[breaks.length]; this.counts = new double[counts.length]; this.quantiles = new double[quantiles.length]; - for(int i = 0; i < breaks.length; ++i) this.breaks[i] = breaks[i]; - for(int i = 0; i < counts.length; ++i) this.counts[i] = counts[i]; - for(int i = 0; i < quantiles.length; ++i) this.quantiles[i] = quantiles[i]; + for(int i = 0; i < breaks.length; ++i) { + this.breaks[i] = breaks[i]; + } + for(int i = 0; i < counts.length; ++i) { + this.counts[i] = counts[i]; + } + for(int i = 0; i < quantiles.length; ++i) { + this.quantiles[i] = quantiles[i]; + } } @Override diff --git a/processing/src/main/java/io/druid/query/aggregation/LongMaxAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/LongMaxAggregatorFactory.java index 91f8c11fee34..b150763c6823 100644 --- a/processing/src/main/java/io/druid/query/aggregation/LongMaxAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/LongMaxAggregatorFactory.java @@ -168,13 +168,21 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } LongMaxAggregatorFactory that = (LongMaxAggregatorFactory) o; - if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) return false; - if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) { + return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/aggregation/LongMinAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/LongMinAggregatorFactory.java index 82f2111a43a5..a4b6bf34af6d 100644 --- a/processing/src/main/java/io/druid/query/aggregation/LongMinAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/LongMinAggregatorFactory.java @@ -168,13 +168,21 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } LongMinAggregatorFactory that = (LongMinAggregatorFactory) o; - if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) return false; - if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) { + return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactory.java index 5744b762bd2e..3670c015ca80 100644 --- a/processing/src/main/java/io/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactory.java @@ -227,13 +227,21 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } HyperUniquesAggregatorFactory that = (HyperUniquesAggregatorFactory) o; - if (!fieldName.equals(that.fieldName)) return false; - if (!name.equals(that.name)) return false; + if (!fieldName.equals(that.fieldName)) { + return false; + } + if (!name.equals(that.name)) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/aggregation/post/FieldAccessPostAggregator.java b/processing/src/main/java/io/druid/query/aggregation/post/FieldAccessPostAggregator.java index 6ded9402282e..64b369366498 100644 --- a/processing/src/main/java/io/druid/query/aggregation/post/FieldAccessPostAggregator.java +++ b/processing/src/main/java/io/druid/query/aggregation/post/FieldAccessPostAggregator.java @@ -88,13 +88,21 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } FieldAccessPostAggregator that = (FieldAccessPostAggregator) o; - if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) return false; - if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) { + return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/dimension/DefaultDimensionSpec.java b/processing/src/main/java/io/druid/query/dimension/DefaultDimensionSpec.java index 4f1b6447db68..14f971c6202f 100644 --- a/processing/src/main/java/io/druid/query/dimension/DefaultDimensionSpec.java +++ b/processing/src/main/java/io/druid/query/dimension/DefaultDimensionSpec.java @@ -128,14 +128,22 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; + if (this == o) { + return true; + } // LegacyDimensionSpec can be equal to DefaultDimensionSpec - if (!(o instanceof DefaultDimensionSpec)) return false; + if (!(o instanceof DefaultDimensionSpec)) { + return false; + } DefaultDimensionSpec that = (DefaultDimensionSpec) o; - if (dimension != null ? !dimension.equals(that.dimension) : that.dimension != null) return false; - if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null) return false; + if (dimension != null ? !dimension.equals(that.dimension) : that.dimension != null) { + return false; + } + if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/dimension/ExtractionDimensionSpec.java b/processing/src/main/java/io/druid/query/dimension/ExtractionDimensionSpec.java index 802f3776b91c..da3bd4ae7692 100644 --- a/processing/src/main/java/io/druid/query/dimension/ExtractionDimensionSpec.java +++ b/processing/src/main/java/io/druid/query/dimension/ExtractionDimensionSpec.java @@ -121,15 +121,24 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } ExtractionDimensionSpec that = (ExtractionDimensionSpec) o; - if (extractionFn != null ? !extractionFn.equals(that.extractionFn) : that.extractionFn != null) + if (extractionFn != null ? !extractionFn.equals(that.extractionFn) : that.extractionFn != null) { + return false; + } + if (dimension != null ? !dimension.equals(that.dimension) : that.dimension != null) { + return false; + } + if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null) { return false; - if (dimension != null ? !dimension.equals(that.dimension) : that.dimension != null) return false; - if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null) return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/search/SearchQueryRunner.java b/processing/src/main/java/io/druid/query/search/SearchQueryRunner.java index a690cfaf092d..22d425f70431 100644 --- a/processing/src/main/java/io/druid/query/search/SearchQueryRunner.java +++ b/processing/src/main/java/io/druid/query/search/SearchQueryRunner.java @@ -256,11 +256,11 @@ protected int getStartIndexOfTime(GenericColumn timeValues, long time, boolean i int mid = (low + high) >>> 1; long midVal = timeValues.getLongSingleValueRow(mid); - if (midVal < time) + if (midVal < time) { low = mid + 1; - else if (midVal > time) + } else if (midVal > time) { high = mid - 1; - else { // key found + } else { // key found int i; // rewind the index of the same time values for (i = mid - 1; i >= 0; i--) { diff --git a/processing/src/main/java/io/druid/query/search/search/SearchQuery.java b/processing/src/main/java/io/druid/query/search/search/SearchQuery.java index 8f5cd64d7b0f..7ca2884e39e6 100644 --- a/processing/src/main/java/io/druid/query/search/search/SearchQuery.java +++ b/processing/src/main/java/io/druid/query/search/search/SearchQuery.java @@ -223,18 +223,36 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } SearchQuery that = (SearchQuery) o; - if (limit != that.limit) return false; - if (dimFilter != null ? !dimFilter.equals(that.dimFilter) : that.dimFilter != null) return false; - if (dimensions != null ? !dimensions.equals(that.dimensions) : that.dimensions != null) return false; - if (granularity != null ? !granularity.equals(that.granularity) : that.granularity != null) return false; - if (querySpec != null ? !querySpec.equals(that.querySpec) : that.querySpec != null) return false; - if (sortSpec != null ? !sortSpec.equals(that.sortSpec) : that.sortSpec != null) return false; + if (limit != that.limit) { + return false; + } + if (dimFilter != null ? !dimFilter.equals(that.dimFilter) : that.dimFilter != null) { + return false; + } + if (dimensions != null ? !dimensions.equals(that.dimensions) : that.dimensions != null) { + return false; + } + if (granularity != null ? !granularity.equals(that.granularity) : that.granularity != null) { + return false; + } + if (querySpec != null ? !querySpec.equals(that.querySpec) : that.querySpec != null) { + return false; + } + if (sortSpec != null ? !sortSpec.equals(that.sortSpec) : that.sortSpec != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/select/SelectQuery.java b/processing/src/main/java/io/druid/query/select/SelectQuery.java index fb552447c432..e53aa36ad2c6 100644 --- a/processing/src/main/java/io/druid/query/select/SelectQuery.java +++ b/processing/src/main/java/io/druid/query/select/SelectQuery.java @@ -227,17 +227,33 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } SelectQuery that = (SelectQuery) o; - if (dimFilter != null ? !dimFilter.equals(that.dimFilter) : that.dimFilter != null) return false; - if (dimensions != null ? !dimensions.equals(that.dimensions) : that.dimensions != null) return false; - if (granularity != null ? !granularity.equals(that.granularity) : that.granularity != null) return false; - if (metrics != null ? !metrics.equals(that.metrics) : that.metrics != null) return false; - if (pagingSpec != null ? !pagingSpec.equals(that.pagingSpec) : that.pagingSpec != null) return false; + if (dimFilter != null ? !dimFilter.equals(that.dimFilter) : that.dimFilter != null) { + return false; + } + if (dimensions != null ? !dimensions.equals(that.dimensions) : that.dimensions != null) { + return false; + } + if (granularity != null ? !granularity.equals(that.granularity) : that.granularity != null) { + return false; + } + if (metrics != null ? !metrics.equals(that.metrics) : that.metrics != null) { + return false; + } + if (pagingSpec != null ? !pagingSpec.equals(that.pagingSpec) : that.pagingSpec != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java b/processing/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java index 61ae8286f0c3..92a57cc49666 100644 --- a/processing/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java +++ b/processing/src/main/java/io/druid/query/spec/MultipleIntervalSegmentSpec.java @@ -68,12 +68,18 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } MultipleIntervalSegmentSpec that = (MultipleIntervalSegmentSpec) o; - if (intervals != null ? !intervals.equals(that.intervals) : that.intervals != null) return false; + if (intervals != null ? !intervals.equals(that.intervals) : that.intervals != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java b/processing/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java index 16c7aecd00cd..01a05fb15c1b 100644 --- a/processing/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java +++ b/processing/src/main/java/io/druid/query/spec/MultipleSpecificSegmentSpec.java @@ -95,13 +95,21 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } MultipleSpecificSegmentSpec that = (MultipleSpecificSegmentSpec) o; - if (descriptors != null ? !descriptors.equals(that.descriptors) : that.descriptors != null) return false; - if (intervals != null ? !intervals.equals(that.intervals) : that.intervals != null) return false; + if (descriptors != null ? !descriptors.equals(that.descriptors) : that.descriptors != null) { + return false; + } + if (intervals != null ? !intervals.equals(that.intervals) : that.intervals != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/spec/SpecificSegmentSpec.java b/processing/src/main/java/io/druid/query/spec/SpecificSegmentSpec.java index e45b40e76de4..fe69a0485180 100644 --- a/processing/src/main/java/io/druid/query/spec/SpecificSegmentSpec.java +++ b/processing/src/main/java/io/druid/query/spec/SpecificSegmentSpec.java @@ -57,12 +57,18 @@ public QueryRunner lookup(Query query, QuerySegmentWalker walker) @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } SpecificSegmentSpec that = (SpecificSegmentSpec) o; - if (descriptor != null ? !descriptor.equals(that.descriptor) : that.descriptor != null) return false; + if (descriptor != null ? !descriptor.equals(that.descriptor) : that.descriptor != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/timeseries/TimeseriesQuery.java b/processing/src/main/java/io/druid/query/timeseries/TimeseriesQuery.java index 7e3af2167fc8..964bf38fb9d1 100644 --- a/processing/src/main/java/io/druid/query/timeseries/TimeseriesQuery.java +++ b/processing/src/main/java/io/druid/query/timeseries/TimeseriesQuery.java @@ -190,18 +190,30 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } TimeseriesQuery that = (TimeseriesQuery) o; - if (aggregatorSpecs != null ? !aggregatorSpecs.equals(that.aggregatorSpecs) : that.aggregatorSpecs != null) + if (aggregatorSpecs != null ? !aggregatorSpecs.equals(that.aggregatorSpecs) : that.aggregatorSpecs != null) { + return false; + } + if (dimFilter != null ? !dimFilter.equals(that.dimFilter) : that.dimFilter != null) { + return false; + } + if (granularity != null ? !granularity.equals(that.granularity) : that.granularity != null) { return false; - if (dimFilter != null ? !dimFilter.equals(that.dimFilter) : that.dimFilter != null) return false; - if (granularity != null ? !granularity.equals(that.granularity) : that.granularity != null) return false; - if (postAggregatorSpecs != null ? !postAggregatorSpecs.equals(that.postAggregatorSpecs) : that.postAggregatorSpecs != null) + } + if (postAggregatorSpecs != null ? !postAggregatorSpecs.equals(that.postAggregatorSpecs) : that.postAggregatorSpecs != null) { return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/topn/NumericTopNMetricSpec.java b/processing/src/main/java/io/druid/query/topn/NumericTopNMetricSpec.java index 5beda3c2c2d1..48f11a8e3dbd 100644 --- a/processing/src/main/java/io/druid/query/topn/NumericTopNMetricSpec.java +++ b/processing/src/main/java/io/druid/query/topn/NumericTopNMetricSpec.java @@ -174,12 +174,18 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } NumericTopNMetricSpec that = (NumericTopNMetricSpec) o; - if (metric != null ? !metric.equals(that.metric) : that.metric != null) return false; + if (metric != null ? !metric.equals(that.metric) : that.metric != null) { + return false; + } return true; } diff --git a/processing/src/main/java/io/druid/query/topn/TopNQuery.java b/processing/src/main/java/io/druid/query/topn/TopNQuery.java index 71f4c23d3bdf..9231d0c60832 100644 --- a/processing/src/main/java/io/druid/query/topn/TopNQuery.java +++ b/processing/src/main/java/io/druid/query/topn/TopNQuery.java @@ -282,23 +282,39 @@ public String toString() @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } TopNQuery topNQuery = (TopNQuery) o; - if (threshold != topNQuery.threshold) return false; - if (aggregatorSpecs != null ? !aggregatorSpecs.equals(topNQuery.aggregatorSpecs) : topNQuery.aggregatorSpecs != null) + if (threshold != topNQuery.threshold) { return false; - if (dimFilter != null ? !dimFilter.equals(topNQuery.dimFilter) : topNQuery.dimFilter != null) return false; - if (dimensionSpec != null ? !dimensionSpec.equals(topNQuery.dimensionSpec) : topNQuery.dimensionSpec != null) + } + if (aggregatorSpecs != null ? !aggregatorSpecs.equals(topNQuery.aggregatorSpecs) : topNQuery.aggregatorSpecs != null) { return false; - if (granularity != null ? !granularity.equals(topNQuery.granularity) : topNQuery.granularity != null) return false; - if (postAggregatorSpecs != null ? !postAggregatorSpecs.equals(topNQuery.postAggregatorSpecs) : topNQuery.postAggregatorSpecs != null) + } + if (dimFilter != null ? !dimFilter.equals(topNQuery.dimFilter) : topNQuery.dimFilter != null) { return false; - if (topNMetricSpec != null ? !topNMetricSpec.equals(topNQuery.topNMetricSpec) : topNQuery.topNMetricSpec != null) + } + if (dimensionSpec != null ? !dimensionSpec.equals(topNQuery.dimensionSpec) : topNQuery.dimensionSpec != null) { return false; + } + if (granularity != null ? !granularity.equals(topNQuery.granularity) : topNQuery.granularity != null) { + return false; + } + if (postAggregatorSpecs != null ? !postAggregatorSpecs.equals(topNQuery.postAggregatorSpecs) : topNQuery.postAggregatorSpecs != null) { + return false; + } + if (topNMetricSpec != null ? !topNMetricSpec.equals(topNQuery.topNMetricSpec) : topNQuery.topNMetricSpec != null) { + return false; + } return true; } diff --git a/processing/src/test/java/io/druid/data/input/ProtoTestEventWrapper.java b/processing/src/test/java/io/druid/data/input/ProtoTestEventWrapper.java index d683f87e2486..d18b28517b4d 100644 --- a/processing/src/test/java/io/druid/data/input/ProtoTestEventWrapper.java +++ b/processing/src/test/java/io/druid/data/input/ProtoTestEventWrapper.java @@ -324,7 +324,9 @@ private void initFields() { private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; + if (isInitialized != -1) { + return isInitialized == 1; + } if (!hasEventType()) { memoizedIsInitialized = 0; @@ -378,7 +380,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; - if (size != -1) return size; + if (size != -1) { + return size; + } size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -649,7 +653,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { } public Builder mergeFrom(ProtoTestEventWrapper.ProtoTestEvent other) { - if (other == ProtoTestEventWrapper.ProtoTestEvent.getDefaultInstance()) return this; + if (other == ProtoTestEventWrapper.ProtoTestEvent.getDefaultInstance()) { + return this; + } if (other.hasEventType()) { setEventType(other.getEventType()); } diff --git a/processing/src/test/java/io/druid/query/aggregation/HistogramTest.java b/processing/src/test/java/io/druid/query/aggregation/HistogramTest.java index c17576635848..169106b4aba8 100644 --- a/processing/src/test/java/io/druid/query/aggregation/HistogramTest.java +++ b/processing/src/test/java/io/druid/query/aggregation/HistogramTest.java @@ -38,7 +38,9 @@ public void testOffer() { Histogram hExpected = new Histogram(breaks, new long[]{1,3,2,3,1,1}, -3f, 2f); Histogram h = new Histogram(breaks); - for(float v : values) h.offer(v); + for(float v : values) { + h.offer(v); + } Assert.assertEquals("histogram matches expected histogram", hExpected, h); } diff --git a/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollectorBenchmark.java b/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollectorBenchmark.java index b67af0686ac0..647a1d533e0c 100644 --- a/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollectorBenchmark.java +++ b/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperLogLogCollectorBenchmark.java @@ -83,7 +83,9 @@ protected void setUp() throws Exception int pos = 0; for(int i = 0; i < count; ++i) { HyperLogLogCollector c = HyperLogLogCollector.makeLatestCollector(); - for(int k = 0; k < 40; ++k) c.add(fn.hashInt(++val).asBytes()); + for(int k = 0; k < 40; ++k) { + c.add(fn.hashInt(++val).asBytes()); + } final ByteBuffer sparseHeapCopy = c.toByteBuffer(); int size = sparseHeapCopy.remaining(); diff --git a/server/src/main/java/io/druid/server/coordinator/rules/LoadRule.java b/server/src/main/java/io/druid/server/coordinator/rules/LoadRule.java index 3c39c54a740d..683b5ac98204 100644 --- a/server/src/main/java/io/druid/server/coordinator/rules/LoadRule.java +++ b/server/src/main/java/io/druid/server/coordinator/rules/LoadRule.java @@ -244,13 +244,16 @@ public void execute() } protected void validateTieredReplicants(Map tieredReplicants){ - if(tieredReplicants.size() == 0) + if(tieredReplicants.size() == 0) { throw new IAE("A rule with empty tiered replicants is invalid"); + } for (Map.Entry entry: tieredReplicants.entrySet()) { - if (entry.getValue() == null) + if (entry.getValue() == null) { throw new IAE("Replicant value cannot be empty"); - if (entry.getValue() < 0) + } + if (entry.getValue() < 0) { throw new IAE("Replicant value [%d] is less than 0, which is not allowed", entry.getValue()); + } } } From 641c16b0b0014d78120b039ea2ea0457f517ab23 Mon Sep 17 00:00:00 2001 From: leventov Date: Fri, 7 Oct 2016 18:54:14 +0300 Subject: [PATCH 4/5] Redundant imports --- .../java/io/druid/benchmark/datagen/BenchmarkSchemaInfo.java | 1 - codestyle/checkstyle.xml | 1 + .../main/java/io/druid/query/timeboundary/TimeBoundaryQuery.java | 1 - .../druid/query/lookup/LookupExtractionFnExpectationsTest.java | 1 - .../test/java/io/druid/query/lookup/LookupExtractionFnTest.java | 1 - .../src/test/java/io/druid/query/lookup/LookupExtractorTest.java | 1 - .../test/java/io/druid/query/ordering/StringComparatorsTest.java | 1 - .../server/lookup/cache/LookupCoordinatorManagerConfigTest.java | 1 - 8 files changed, 1 insertion(+), 7 deletions(-) diff --git a/benchmarks/src/main/java/io/druid/benchmark/datagen/BenchmarkSchemaInfo.java b/benchmarks/src/main/java/io/druid/benchmark/datagen/BenchmarkSchemaInfo.java index 0a81f7ee9908..bc0ff220a865 100644 --- a/benchmarks/src/main/java/io/druid/benchmark/datagen/BenchmarkSchemaInfo.java +++ b/benchmarks/src/main/java/io/druid/benchmark/datagen/BenchmarkSchemaInfo.java @@ -19,7 +19,6 @@ package io.druid.benchmark.datagen; -import io.druid.benchmark.datagen.BenchmarkColumnSchema; import io.druid.query.aggregation.AggregatorFactory; import org.joda.time.Interval; diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml index 0f6538ef7be6..1914eebc6634 100644 --- a/codestyle/checkstyle.xml +++ b/codestyle/checkstyle.xml @@ -31,6 +31,7 @@ + \ No newline at end of file diff --git a/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQuery.java b/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQuery.java index d5e729046ba9..d6c1b9ba6d5a 100644 --- a/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQuery.java +++ b/processing/src/main/java/io/druid/query/timeboundary/TimeBoundaryQuery.java @@ -32,7 +32,6 @@ import io.druid.query.filter.DimFilter; import io.druid.query.spec.MultipleIntervalSegmentSpec; import io.druid.query.spec.QuerySegmentSpec; -import io.druid.query.filter.DimFilter; import org.joda.time.DateTime; import org.joda.time.Interval; diff --git a/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnExpectationsTest.java b/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnExpectationsTest.java index 81d43d310cc6..a363f7606039 100644 --- a/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnExpectationsTest.java +++ b/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnExpectationsTest.java @@ -20,7 +20,6 @@ package io.druid.query.lookup; import com.google.common.collect.ImmutableMap; -import io.druid.query.lookup.LookupExtractionFn; import io.druid.query.extraction.MapLookupExtractor; import org.junit.Assert; import org.junit.Test; diff --git a/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnTest.java b/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnTest.java index 963b4052133f..bf8edbc05532 100644 --- a/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnTest.java +++ b/processing/src/test/java/io/druid/query/lookup/LookupExtractionFnTest.java @@ -30,7 +30,6 @@ import com.google.common.collect.Sets; import com.metamx.common.IAE; import io.druid.jackson.DefaultObjectMapper; -import io.druid.query.lookup.LookupExtractionFn; import io.druid.query.extraction.MapLookupExtractor; import org.junit.Assert; import org.junit.Test; diff --git a/processing/src/test/java/io/druid/query/lookup/LookupExtractorTest.java b/processing/src/test/java/io/druid/query/lookup/LookupExtractorTest.java index aa3cccfd78ca..7adeb7c775d6 100644 --- a/processing/src/test/java/io/druid/query/lookup/LookupExtractorTest.java +++ b/processing/src/test/java/io/druid/query/lookup/LookupExtractorTest.java @@ -24,7 +24,6 @@ import com.google.common.collect.Lists; import io.druid.jackson.DefaultObjectMapper; import io.druid.query.extraction.MapLookupExtractor; -import io.druid.query.lookup.LookupExtractor; import org.junit.Assert; import org.junit.Test; diff --git a/processing/src/test/java/io/druid/query/ordering/StringComparatorsTest.java b/processing/src/test/java/io/druid/query/ordering/StringComparatorsTest.java index b40f721f4517..fb56b5828b6a 100644 --- a/processing/src/test/java/io/druid/query/ordering/StringComparatorsTest.java +++ b/processing/src/test/java/io/druid/query/ordering/StringComparatorsTest.java @@ -32,7 +32,6 @@ import com.google.common.collect.Lists; import io.druid.jackson.DefaultObjectMapper; -import io.druid.query.ordering.StringComparator; public class StringComparatorsTest { diff --git a/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerConfigTest.java b/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerConfigTest.java index 6ca87b650a70..859502b0b2dd 100644 --- a/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerConfigTest.java +++ b/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerConfigTest.java @@ -19,7 +19,6 @@ package io.druid.server.lookup.cache; -import io.druid.server.lookup.cache.LookupCoordinatorManagerConfig; import org.joda.time.Duration; import org.junit.Assert; import org.junit.Test; From c4155da45800c826771f07b649a26f30c43cbc07 Mon Sep 17 00:00:00 2001 From: leventov Date: Tue, 11 Oct 2016 18:25:01 +0300 Subject: [PATCH 5/5] Add NewLineAtEndOfFile check --- codestyle/checkstyle-suppressions.xml | 2 +- codestyle/checkstyle.xml | 4 +++- .../java/io/druid/segment/StringDimensionMergerLegacy.java | 2 +- .../main/java/io/druid/segment/StringDimensionMergerV9.java | 2 +- .../druid/segment/data/BlockLayoutLongSupplierSerializer.java | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/codestyle/checkstyle-suppressions.xml b/codestyle/checkstyle-suppressions.xml index 82fea852b1e0..493a18bee12b 100644 --- a/codestyle/checkstyle-suppressions.xml +++ b/codestyle/checkstyle-suppressions.xml @@ -25,4 +25,4 @@ - \ No newline at end of file + diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml index 1914eebc6634..10e67e44a49b 100644 --- a/codestyle/checkstyle.xml +++ b/codestyle/checkstyle.xml @@ -24,6 +24,8 @@ --> + + @@ -34,4 +36,4 @@ - \ No newline at end of file + diff --git a/processing/src/main/java/io/druid/segment/StringDimensionMergerLegacy.java b/processing/src/main/java/io/druid/segment/StringDimensionMergerLegacy.java index b7221a8d3216..fbe7a9fd64e9 100644 --- a/processing/src/main/java/io/druid/segment/StringDimensionMergerLegacy.java +++ b/processing/src/main/java/io/druid/segment/StringDimensionMergerLegacy.java @@ -236,4 +236,4 @@ public void writeIndexesToFiles( spatialIoPeon.cleanup(); } } -} \ No newline at end of file +} diff --git a/processing/src/main/java/io/druid/segment/StringDimensionMergerV9.java b/processing/src/main/java/io/druid/segment/StringDimensionMergerV9.java index 79cf76a196a3..ea2de6c116ed 100644 --- a/processing/src/main/java/io/druid/segment/StringDimensionMergerV9.java +++ b/processing/src/main/java/io/druid/segment/StringDimensionMergerV9.java @@ -572,4 +572,4 @@ protected boolean isNullColumn(Iterable dimValues) } return true; } -} \ No newline at end of file +} diff --git a/processing/src/main/java/io/druid/segment/data/BlockLayoutLongSupplierSerializer.java b/processing/src/main/java/io/druid/segment/data/BlockLayoutLongSupplierSerializer.java index 6554ba508782..04ca83b24011 100644 --- a/processing/src/main/java/io/druid/segment/data/BlockLayoutLongSupplierSerializer.java +++ b/processing/src/main/java/io/druid/segment/data/BlockLayoutLongSupplierSerializer.java @@ -154,4 +154,4 @@ public void writeToChannel(WritableByteChannel channel) throws IOException ByteStreams.copy(from, channel); } } -} \ No newline at end of file +}