From 8877ce38d6ff0fb131e425127efdb0c62bc9a89d Mon Sep 17 00:00:00 2001 From: Roman Leventov Date: Thu, 11 Jan 2018 09:50:42 +0100 Subject: [PATCH] Enforce modifier order with Checkstyle (#5246) --- .../timeline/partition/NoneShardSpec.java | 2 +- .../druid/guice/ConditionalMultibindTest.java | 2 +- .../io/druid/timeline/DataSegmentTest.java | 4 +-- .../CostBalancerStrategyBenchmark.java | 2 +- .../collections/bitmap/BitmapBenchmark.java | 18 +++++------ codestyle/checkstyle.xml | 2 ++ .../java/io/druid/math/expr/ExprEval.java | 2 +- .../druid/common/utils/StringUtilsTest.java | 2 +- .../extendedset/intset/ConciseSetUtils.java | 14 ++++----- .../intset/ImmutableConciseSet.java | 2 +- .../metrics/AmbariMetricsEmitterConfig.java | 8 ++--- ...asedDruidToTimelineEventConverterTest.java | 4 +-- .../druid/storage/azure/AzureByteSource.java | 6 ++-- .../cloudfiles/CloudFilesByteSource.java | 4 +-- .../graphite/GraphiteEmitterConfig.java | 30 +++++++++---------- .../graphite/WhiteListBasedConverterTest.java | 4 +-- .../io/druid/emitter/kafka/KafkaEmitter.java | 2 +- .../emitter/kafka/KafkaEmitterConfig.java | 8 ++--- .../input/orc/OrcIndexGeneratorJobTest.java | 2 +- .../emitter/statsd/DimensionConverter.java | 2 +- .../druid/emitter/statsd/StatsDEmitter.java | 8 ++--- .../emitter/statsd/StatsDEmitterConfig.java | 14 ++++----- .../input/thrift/ThriftInputRowParser.java | 2 +- .../io/druid/segment/MapVirtualColumn.java | 2 +- .../theta/SketchEstimateWithErrorBounds.java | 8 ++--- .../theta/SketchAggregationTest.java | 2 +- .../SketchAggregationWithSimpleDataTest.java | 2 +- .../oldapi/OldApiSketchAggregationTest.java | 2 +- .../druid/security/basic/BasicAuthUtils.java | 12 ++++---- ...thenticatorMetadataStorageUpdaterTest.java | 2 +- ...dinatorBasicAuthenticatorResourceTest.java | 4 +-- ...cAuthorizerMetadataStorageUpdaterTest.java | 6 ++-- ...oordinatorBasicAuthorizerResourceTest.java | 4 +-- .../druid/indexing/kafka/test/TestBroker.java | 2 +- .../server/lookup/LoadingLookupFactory.java | 2 +- .../cache/loading/OnHeapLoadingCache.java | 2 +- .../io/druid/hll/HyperLogLogCollector.java | 4 +-- .../druid/indexer/DeterminePartitionsJob.java | 2 +- .../indexer/HadoopDruidIndexerMapper.java | 2 +- .../druid/indexer/IndexGeneratorJobTest.java | 4 +-- .../indexing/common/task/HadoopTask.java | 2 +- .../common/task/RealtimeIndexTask.java | 2 +- .../druid/indexing/overlord/TaskLockbox.java | 4 +-- .../IngestSegmentFirehoseFactoryTest.java | 4 +-- ...dingTaskBasedProvisioningStrategyTest.java | 4 +-- ...TestIndexerMetadataStorageCoordinator.java | 6 ++-- .../testing/ConfigFileConfigProvider.java | 2 +- .../clients/OverlordResourceTestClient.java | 2 +- .../java/io/druid/query/DruidMetrics.java | 20 ++++++------- .../query/aggregation/HistogramVisual.java | 6 ++-- .../io/druid/query/filter/AndDimFilter.java | 2 +- .../io/druid/query/filter/NotDimFilter.java | 2 +- .../io/druid/query/filter/OrDimFilter.java | 2 +- .../io/druid/query/groupby/GroupByQuery.java | 4 +-- .../query/groupby/GroupByQueryHelper.java | 2 +- .../druid/query/topn/BaseTopNAlgorithm.java | 2 +- .../druid/segment/DimensionHandlerUtils.java | 2 +- .../segment/data/CompressionStrategy.java | 2 +- .../druid/segment/data/ZeroIndexedInts.java | 2 +- .../io/druid/query/AsyncQueryRunnerTest.java | 2 +- .../io/druid/query/QueryRunnerTestHelper.java | 2 +- .../CardinalityAggregatorBenchmark.java | 2 +- .../HyperUniquesAggregatorFactoryTest.java | 4 +-- .../dimension/TestDimensionSelector.java | 2 +- .../groupby/GroupByQueryMergeBufferTest.java | 2 +- .../GroupByQueryRunnerFailureTest.java | 2 +- .../client/BatchServerInventoryView.java | 6 ++-- .../client/SingleServerInventoryView.java | 2 +- .../java/io/druid/client/cache/Cache.java | 4 +-- .../io/druid/client/cache/MemcachedCache.java | 2 +- .../druid/initialization/Initialization.java | 4 +-- .../lookup/MapLookupExtractorFactory.java | 2 +- .../coordination/SegmentLoadDropHandler.java | 4 +-- .../coordinator/CoordinatorDynamicConfig.java | 20 ++++++------- .../helper/DruidCoordinatorSegmentKiller.java | 2 +- .../initialization/jetty/JettyRequestLog.java | 2 +- .../druid/server/metrics/MonitorsConfig.java | 2 +- .../java/io/druid/server/security/Access.java | 2 +- .../timeline/partition/NumberedShardSpec.java | 4 +-- .../coordinator/rules/PeriodDropRuleTest.java | 2 +- .../coordinator/rules/PeriodLoadRuleTest.java | 2 +- .../io/druid/sql/calcite/rule/DruidRules.java | 2 +- 82 files changed, 179 insertions(+), 177 deletions(-) diff --git a/api/src/main/java/io/druid/timeline/partition/NoneShardSpec.java b/api/src/main/java/io/druid/timeline/partition/NoneShardSpec.java index c116c60c8b8..1fcadfb42d2 100644 --- a/api/src/main/java/io/druid/timeline/partition/NoneShardSpec.java +++ b/api/src/main/java/io/druid/timeline/partition/NoneShardSpec.java @@ -32,7 +32,7 @@ import java.util.Map; */ public class NoneShardSpec implements ShardSpec { - private final static NoneShardSpec INSTANCE = new NoneShardSpec(); + private static final NoneShardSpec INSTANCE = new NoneShardSpec(); @JsonCreator public static NoneShardSpec instance() diff --git a/api/src/test/java/io/druid/guice/ConditionalMultibindTest.java b/api/src/test/java/io/druid/guice/ConditionalMultibindTest.java index 4cbca482d85..5513166590a 100644 --- a/api/src/test/java/io/druid/guice/ConditionalMultibindTest.java +++ b/api/src/test/java/io/druid/guice/ConditionalMultibindTest.java @@ -312,7 +312,7 @@ public class ConditionalMultibindTest Assert.assertEquals(ImmutableSet.of(zoo1, zoo2), actualZooSet); } - static abstract class Animal + abstract static class Animal { private final String type; diff --git a/api/src/test/java/io/druid/timeline/DataSegmentTest.java b/api/src/test/java/io/druid/timeline/DataSegmentTest.java index 4222775521f..4aac88c0914 100644 --- a/api/src/test/java/io/druid/timeline/DataSegmentTest.java +++ b/api/src/test/java/io/druid/timeline/DataSegmentTest.java @@ -50,8 +50,8 @@ import java.util.Set; */ public class DataSegmentTest { - private final static ObjectMapper mapper = new TestObjectMapper(); - private final static int TEST_VERSION = 0x7; + private static final ObjectMapper mapper = new TestObjectMapper(); + private static final int TEST_VERSION = 0x7; private static ShardSpec getShardSpec(final int partitionNum) { diff --git a/benchmarks/src/main/java/io/druid/server/coordinator/CostBalancerStrategyBenchmark.java b/benchmarks/src/main/java/io/druid/server/coordinator/CostBalancerStrategyBenchmark.java index 4f397ec882c..815debf12ad 100644 --- a/benchmarks/src/main/java/io/druid/server/coordinator/CostBalancerStrategyBenchmark.java +++ b/benchmarks/src/main/java/io/druid/server/coordinator/CostBalancerStrategyBenchmark.java @@ -40,7 +40,7 @@ import java.util.concurrent.TimeUnit; @State(Scope.Benchmark) public class CostBalancerStrategyBenchmark { - private final static DateTime t0 = DateTimes.of("2016-01-01T01:00:00Z"); + private static final DateTime t0 = DateTimes.of("2016-01-01T01:00:00Z"); private List segments; private DataSegment segment; diff --git a/bytebuffer-collections/src/test/java/io/druid/collections/bitmap/BitmapBenchmark.java b/bytebuffer-collections/src/test/java/io/druid/collections/bitmap/BitmapBenchmark.java index 93ee6eb9c90..aad7f93d2a8 100755 --- a/bytebuffer-collections/src/test/java/io/druid/collections/bitmap/BitmapBenchmark.java +++ b/bytebuffer-collections/src/test/java/io/druid/collections/bitmap/BitmapBenchmark.java @@ -45,15 +45,15 @@ public class BitmapBenchmark { public static final int LENGTH = 500_000; public static final int SIZE = 10_000; - final static ImmutableConciseSet concise[] = new ImmutableConciseSet[SIZE]; - final static ImmutableConciseSet offheapConcise[] = new ImmutableConciseSet[SIZE]; - final static ImmutableRoaringBitmap roaring[] = new ImmutableRoaringBitmap[SIZE]; - final static ImmutableRoaringBitmap immutableRoaring[] = new ImmutableRoaringBitmap[SIZE]; - final static ImmutableRoaringBitmap offheapRoaring[] = new ImmutableRoaringBitmap[SIZE]; - final static ImmutableBitmap genericConcise[] = new ImmutableBitmap[SIZE]; - final static ImmutableBitmap genericRoaring[] = new ImmutableBitmap[SIZE]; - final static ConciseBitmapFactory conciseFactory = new ConciseBitmapFactory(); - final static RoaringBitmapFactory roaringFactory = new RoaringBitmapFactory(); + static final ImmutableConciseSet concise[] = new ImmutableConciseSet[SIZE]; + static final ImmutableConciseSet offheapConcise[] = new ImmutableConciseSet[SIZE]; + static final ImmutableRoaringBitmap roaring[] = new ImmutableRoaringBitmap[SIZE]; + static final ImmutableRoaringBitmap immutableRoaring[] = new ImmutableRoaringBitmap[SIZE]; + static final ImmutableRoaringBitmap offheapRoaring[] = new ImmutableRoaringBitmap[SIZE]; + static final ImmutableBitmap genericConcise[] = new ImmutableBitmap[SIZE]; + static final ImmutableBitmap genericRoaring[] = new ImmutableBitmap[SIZE]; + static final ConciseBitmapFactory conciseFactory = new ConciseBitmapFactory(); + static final RoaringBitmapFactory roaringFactory = new RoaringBitmapFactory(); static Random rand = new Random(0); static long totalConciseBytes = 0; static long totalRoaringBytes = 0; diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml index 53f12b85ae9..a38d63c4e30 100644 --- a/codestyle/checkstyle.xml +++ b/codestyle/checkstyle.xml @@ -99,6 +99,8 @@ + + diff --git a/common/src/main/java/io/druid/math/expr/ExprEval.java b/common/src/main/java/io/druid/math/expr/ExprEval.java index 630347982a2..972ce342fe5 100644 --- a/common/src/main/java/io/druid/math/expr/ExprEval.java +++ b/common/src/main/java/io/druid/math/expr/ExprEval.java @@ -119,7 +119,7 @@ public abstract class ExprEval public abstract Expr toExpr(); - private static abstract class NumericExprEval extends ExprEval + private abstract static class NumericExprEval extends ExprEval { private NumericExprEval(Number value) diff --git a/common/src/test/java/io/druid/common/utils/StringUtilsTest.java b/common/src/test/java/io/druid/common/utils/StringUtilsTest.java index e0b5c881b77..1e1f8cf12eb 100644 --- a/common/src/test/java/io/druid/common/utils/StringUtilsTest.java +++ b/common/src/test/java/io/druid/common/utils/StringUtilsTest.java @@ -30,7 +30,7 @@ import java.io.UnsupportedEncodingException; public class StringUtilsTest { // copied from https://github.com/druid-io/druid/pull/2612 - public final static String[] TEST_STRINGS = new String[]{ + public static final String[] TEST_STRINGS = new String[]{ "peach", "péché", "pêche", "sin", "", "☃", "C", "c", "Ç", "ç", "G", "g", "Ğ", "ğ", "I", "ı", "İ", "i", "O", "o", "Ö", "ö", "S", "s", "Ş", "ş", "U", "u", "Ü", "ü", "ä", diff --git a/extendedset/src/main/java/io/druid/extendedset/intset/ConciseSetUtils.java b/extendedset/src/main/java/io/druid/extendedset/intset/ConciseSetUtils.java index 35438fcb7f6..43b80202d0c 100755 --- a/extendedset/src/main/java/io/druid/extendedset/intset/ConciseSetUtils.java +++ b/extendedset/src/main/java/io/druid/extendedset/intset/ConciseSetUtils.java @@ -22,37 +22,37 @@ public class ConciseSetUtils * 31 * (1 << 25), followed by a literal with 30 0's and the * MSB (31st bit) equal to 1 */ - public final static int MAX_ALLOWED_INTEGER = 31 * (1 << 25) + 30; // 1040187422 + public static final int MAX_ALLOWED_INTEGER = 31 * (1 << 25) + 30; // 1040187422 /** * The lowest representable integer. */ - public final static int MIN_ALLOWED_SET_BIT = 0; + public static final int MIN_ALLOWED_SET_BIT = 0; /** * Maximum number of representable bits within a literal */ - public final static int MAX_LITERAL_LENGTH = 31; + public static final int MAX_LITERAL_LENGTH = 31; /** * Literal that represents all bits set to 1 (and MSB = 1) */ - public final static int ALL_ONES_LITERAL = 0xFFFFFFFF; + public static final int ALL_ONES_LITERAL = 0xFFFFFFFF; /** * Literal that represents all bits set to 0 (and MSB = 1) */ - public final static int ALL_ZEROS_LITERAL = 0x80000000; + public static final int ALL_ZEROS_LITERAL = 0x80000000; /** * All bits set to 1 and MSB = 0 */ - public final static int ALL_ONES_WITHOUT_MSB = 0x7FFFFFFF; + public static final int ALL_ONES_WITHOUT_MSB = 0x7FFFFFFF; /** * Sequence bit */ - public final static int SEQUENCE_BIT = 0x40000000; + public static final int SEQUENCE_BIT = 0x40000000; /** * Calculates the modulus division by 31 in a faster way than using n % 31 diff --git a/extendedset/src/main/java/io/druid/extendedset/intset/ImmutableConciseSet.java b/extendedset/src/main/java/io/druid/extendedset/intset/ImmutableConciseSet.java index bb63da835fd..87c5f15b713 100755 --- a/extendedset/src/main/java/io/druid/extendedset/intset/ImmutableConciseSet.java +++ b/extendedset/src/main/java/io/druid/extendedset/intset/ImmutableConciseSet.java @@ -34,7 +34,7 @@ import java.util.PriorityQueue; public class ImmutableConciseSet { - private final static int CHUNK_SIZE = 10000; + private static final int CHUNK_SIZE = 10000; private static final Comparator UNION_COMPARATOR = new Comparator() { diff --git a/extensions-contrib/ambari-metrics-emitter/src/main/java/io/druid/emitter/ambari/metrics/AmbariMetricsEmitterConfig.java b/extensions-contrib/ambari-metrics-emitter/src/main/java/io/druid/emitter/ambari/metrics/AmbariMetricsEmitterConfig.java index a16cbcc92a7..31f0daa9d7e 100644 --- a/extensions-contrib/ambari-metrics-emitter/src/main/java/io/druid/emitter/ambari/metrics/AmbariMetricsEmitterConfig.java +++ b/extensions-contrib/ambari-metrics-emitter/src/main/java/io/druid/emitter/ambari/metrics/AmbariMetricsEmitterConfig.java @@ -29,10 +29,10 @@ import java.util.List; public class AmbariMetricsEmitterConfig { - private final static int DEFAULT_BATCH_SIZE = 100; - private final static Long DEFAULT_FLUSH_PERIOD_MILLIS = (long) (60 * 1000); // flush every one minute - private final static long DEFAULT_GET_TIMEOUT = 1000; // default wait for get operations on the queue 1 sec - private final static String DEFAULT_PROTOCOL = "http"; + private static final int DEFAULT_BATCH_SIZE = 100; + private static final Long DEFAULT_FLUSH_PERIOD_MILLIS = (long) (60 * 1000); // flush every one minute + private static final long DEFAULT_GET_TIMEOUT = 1000; // default wait for get operations on the queue 1 sec + private static final String DEFAULT_PROTOCOL = "http"; @JsonProperty private final String hostname; diff --git a/extensions-contrib/ambari-metrics-emitter/src/test/java/io/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverterTest.java b/extensions-contrib/ambari-metrics-emitter/src/test/java/io/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverterTest.java index eeb4048a9b4..9a9cf485dd0 100644 --- a/extensions-contrib/ambari-metrics-emitter/src/test/java/io/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverterTest.java +++ b/extensions-contrib/ambari-metrics-emitter/src/test/java/io/druid/emitter/ambari/metrics/WhiteListBasedDruidToTimelineEventConverterTest.java @@ -37,8 +37,8 @@ import org.junit.runner.RunWith; @RunWith(JUnitParamsRunner.class) public class WhiteListBasedDruidToTimelineEventConverterTest { - final private String prefix = "druid"; - final private WhiteListBasedDruidToTimelineEventConverter defaultWhiteListBasedDruidToTimelineEventConverter = new WhiteListBasedDruidToTimelineEventConverter( + private final String prefix = "druid"; + private final WhiteListBasedDruidToTimelineEventConverter defaultWhiteListBasedDruidToTimelineEventConverter = new WhiteListBasedDruidToTimelineEventConverter( prefix, "druid", null, diff --git a/extensions-contrib/azure-extensions/src/main/java/io/druid/storage/azure/AzureByteSource.java b/extensions-contrib/azure-extensions/src/main/java/io/druid/storage/azure/AzureByteSource.java index 548478aabe8..d6f3fa9bd36 100644 --- a/extensions-contrib/azure-extensions/src/main/java/io/druid/storage/azure/AzureByteSource.java +++ b/extensions-contrib/azure-extensions/src/main/java/io/druid/storage/azure/AzureByteSource.java @@ -30,9 +30,9 @@ import java.net.URISyntaxException; public class AzureByteSource extends ByteSource { - final private AzureStorage azureStorage; - final private String containerName; - final private String blobPath; + private final AzureStorage azureStorage; + private final String containerName; + private final String blobPath; public AzureByteSource( AzureStorage azureStorage, diff --git a/extensions-contrib/cloudfiles-extensions/src/main/java/io/druid/storage/cloudfiles/CloudFilesByteSource.java b/extensions-contrib/cloudfiles-extensions/src/main/java/io/druid/storage/cloudfiles/CloudFilesByteSource.java index 7a36dad3b34..4d093194090 100644 --- a/extensions-contrib/cloudfiles-extensions/src/main/java/io/druid/storage/cloudfiles/CloudFilesByteSource.java +++ b/extensions-contrib/cloudfiles-extensions/src/main/java/io/druid/storage/cloudfiles/CloudFilesByteSource.java @@ -29,8 +29,8 @@ import java.io.InputStream; public class CloudFilesByteSource extends ByteSource { - final private CloudFilesObjectApiProxy objectApi; - final private String path; + private final CloudFilesObjectApiProxy objectApi; + private final String path; private Payload payload; public CloudFilesByteSource(CloudFilesObjectApiProxy objectApi, String path) diff --git a/extensions-contrib/graphite-emitter/src/main/java/io/druid/emitter/graphite/GraphiteEmitterConfig.java b/extensions-contrib/graphite-emitter/src/main/java/io/druid/emitter/graphite/GraphiteEmitterConfig.java index 5fc11d62c0c..b0ec43ea434 100644 --- a/extensions-contrib/graphite-emitter/src/main/java/io/druid/emitter/graphite/GraphiteEmitterConfig.java +++ b/extensions-contrib/graphite-emitter/src/main/java/io/druid/emitter/graphite/GraphiteEmitterConfig.java @@ -29,36 +29,36 @@ import java.util.List; public class GraphiteEmitterConfig { - public final static String PLAINTEXT_PROTOCOL = "plaintext"; - public final static String PICKLE_PROTOCOL = "pickle"; - private final static int DEFAULT_BATCH_SIZE = 100; + public static final String PLAINTEXT_PROTOCOL = "plaintext"; + public static final String PICKLE_PROTOCOL = "pickle"; + private static final int DEFAULT_BATCH_SIZE = 100; private static final Long DEFAULT_FLUSH_PERIOD = (long) (60 * 1000); // flush every one minute - private final static long DEFAULT_GET_TIMEOUT = 1000; // default wait for get operations on the queue 1 sec + private static final long DEFAULT_GET_TIMEOUT = 1000; // default wait for get operations on the queue 1 sec @JsonProperty - final private String hostname; + private final String hostname; @JsonProperty - final private int port; + private final int port; @JsonProperty - final private int batchSize; + private final int batchSize; @JsonProperty - final private String protocol; + private final String protocol; @JsonProperty - final private Long flushPeriod; + private final Long flushPeriod; @JsonProperty - final private Integer maxQueueSize; + private final Integer maxQueueSize; @JsonProperty("eventConverter") - final private DruidToGraphiteEventConverter druidToGraphiteEventConverter; + private final DruidToGraphiteEventConverter druidToGraphiteEventConverter; @JsonProperty - final private List alertEmitters; + private final List alertEmitters; @JsonProperty - final private List requestLogEmitters; + private final List requestLogEmitters; @JsonProperty - final private Long emitWaitTime; + private final Long emitWaitTime; //waiting up to the specified wait time if necessary for an event to become available. @JsonProperty - final private Long waitForEventTime; + private final Long waitForEventTime; @Override public boolean equals(Object o) diff --git a/extensions-contrib/graphite-emitter/src/test/java/io/druid/emitter/graphite/WhiteListBasedConverterTest.java b/extensions-contrib/graphite-emitter/src/test/java/io/druid/emitter/graphite/WhiteListBasedConverterTest.java index 11908fb1bb2..89209e01e78 100644 --- a/extensions-contrib/graphite-emitter/src/test/java/io/druid/emitter/graphite/WhiteListBasedConverterTest.java +++ b/extensions-contrib/graphite-emitter/src/test/java/io/druid/emitter/graphite/WhiteListBasedConverterTest.java @@ -36,8 +36,8 @@ import org.junit.runner.RunWith; @RunWith(JUnitParamsRunner.class) public class WhiteListBasedConverterTest { - final private String prefix = "druid"; - final private WhiteListBasedConverter defaultWhiteListBasedConverter = new WhiteListBasedConverter( + private final String prefix = "druid"; + private final WhiteListBasedConverter defaultWhiteListBasedConverter = new WhiteListBasedConverter( prefix, false, false, diff --git a/extensions-contrib/kafka-emitter/src/main/java/io/druid/emitter/kafka/KafkaEmitter.java b/extensions-contrib/kafka-emitter/src/main/java/io/druid/emitter/kafka/KafkaEmitter.java index 7a791be5c84..179fa90f296 100644 --- a/extensions-contrib/kafka-emitter/src/main/java/io/druid/emitter/kafka/KafkaEmitter.java +++ b/extensions-contrib/kafka-emitter/src/main/java/io/druid/emitter/kafka/KafkaEmitter.java @@ -50,7 +50,7 @@ public class KafkaEmitter implements Emitter { private static Logger log = new Logger(KafkaEmitter.class); - private final static int DEFAULT_RETRIES = 3; + private static final int DEFAULT_RETRIES = 3; private final AtomicLong metricLost; private final AtomicLong alertLost; private final AtomicLong invalidLost; diff --git a/extensions-contrib/kafka-emitter/src/main/java/io/druid/emitter/kafka/KafkaEmitterConfig.java b/extensions-contrib/kafka-emitter/src/main/java/io/druid/emitter/kafka/KafkaEmitterConfig.java index 94f740b1d39..24074a4638d 100644 --- a/extensions-contrib/kafka-emitter/src/main/java/io/druid/emitter/kafka/KafkaEmitterConfig.java +++ b/extensions-contrib/kafka-emitter/src/main/java/io/druid/emitter/kafka/KafkaEmitterConfig.java @@ -32,13 +32,13 @@ public class KafkaEmitterConfig { @JsonProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG) - final private String bootstrapServers; + private final String bootstrapServers; @JsonProperty("metric.topic") - final private String metricTopic; + private final String metricTopic; @JsonProperty("alert.topic") - final private String alertTopic; + private final String alertTopic; @JsonProperty - final private String clusterName; + private final String clusterName; @JsonProperty("producer.config") private Map kafkaProducerConfig; diff --git a/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcIndexGeneratorJobTest.java b/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcIndexGeneratorJobTest.java index d68f2e93dc5..283a5bcbbed 100644 --- a/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcIndexGeneratorJobTest.java +++ b/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcIndexGeneratorJobTest.java @@ -85,7 +85,7 @@ import java.util.zip.ZipInputStream; public class OrcIndexGeneratorJobTest { - static private final AggregatorFactory[] aggs = { + private static final AggregatorFactory[] aggs = { new LongSumAggregatorFactory("visited_num", "visited_num"), new HyperUniquesAggregatorFactory("unique_hosts", "host") }; diff --git a/extensions-contrib/statsd-emitter/src/main/java/io/druid/emitter/statsd/DimensionConverter.java b/extensions-contrib/statsd-emitter/src/main/java/io/druid/emitter/statsd/DimensionConverter.java index ed3521f1418..16279a0ad39 100644 --- a/extensions-contrib/statsd-emitter/src/main/java/io/druid/emitter/statsd/DimensionConverter.java +++ b/extensions-contrib/statsd-emitter/src/main/java/io/druid/emitter/statsd/DimensionConverter.java @@ -38,7 +38,7 @@ import java.util.Map; public class DimensionConverter { - private final static Logger log = new Logger(DimensionConverter.class); + private static final Logger log = new Logger(DimensionConverter.class); private Map metricMap; public DimensionConverter(ObjectMapper mapper, String dimensionMapPath) diff --git a/extensions-contrib/statsd-emitter/src/main/java/io/druid/emitter/statsd/StatsDEmitter.java b/extensions-contrib/statsd-emitter/src/main/java/io/druid/emitter/statsd/StatsDEmitter.java index c949f13f477..a575a6664f8 100644 --- a/extensions-contrib/statsd-emitter/src/main/java/io/druid/emitter/statsd/StatsDEmitter.java +++ b/extensions-contrib/statsd-emitter/src/main/java/io/druid/emitter/statsd/StatsDEmitter.java @@ -38,10 +38,10 @@ import java.util.Map; public class StatsDEmitter implements Emitter { - private final static Logger log = new Logger(StatsDEmitter.class); - private final static String DRUID_METRIC_SEPARATOR = "\\/"; - private final static String STATSD_SEPARATOR = ":|\\|"; - private final static String BLANK = "\\s+"; + private static final Logger log = new Logger(StatsDEmitter.class); + private static final String DRUID_METRIC_SEPARATOR = "\\/"; + private static final String STATSD_SEPARATOR = ":|\\|"; + private static final String BLANK = "\\s+"; static final StatsDEmitter of(StatsDEmitterConfig config, ObjectMapper mapper) { diff --git a/extensions-contrib/statsd-emitter/src/main/java/io/druid/emitter/statsd/StatsDEmitterConfig.java b/extensions-contrib/statsd-emitter/src/main/java/io/druid/emitter/statsd/StatsDEmitterConfig.java index f7f5a357e11..a346083521d 100644 --- a/extensions-contrib/statsd-emitter/src/main/java/io/druid/emitter/statsd/StatsDEmitterConfig.java +++ b/extensions-contrib/statsd-emitter/src/main/java/io/druid/emitter/statsd/StatsDEmitterConfig.java @@ -29,19 +29,19 @@ public class StatsDEmitterConfig { @JsonProperty - final private String hostname; + private final String hostname; @JsonProperty - final private Integer port; + private final Integer port; @JsonProperty - final private String prefix; + private final String prefix; @JsonProperty - final private String separator; + private final String separator; @JsonProperty - final private Boolean includeHost; + private final Boolean includeHost; @JsonProperty - final private String dimensionMapPath; + private final String dimensionMapPath; @JsonProperty - final private String blankHolder; + private final String blankHolder; @JsonCreator public StatsDEmitterConfig( diff --git a/extensions-contrib/thrift-extensions/src/main/java/io/druid/data/input/thrift/ThriftInputRowParser.java b/extensions-contrib/thrift-extensions/src/main/java/io/druid/data/input/thrift/ThriftInputRowParser.java index 87169252b8f..9984153b2c0 100644 --- a/extensions-contrib/thrift-extensions/src/main/java/io/druid/data/input/thrift/ThriftInputRowParser.java +++ b/extensions-contrib/thrift-extensions/src/main/java/io/druid/data/input/thrift/ThriftInputRowParser.java @@ -54,7 +54,7 @@ public class ThriftInputRowParser implements InputRowParser private final String thriftClassName; private Parser parser; - volatile private Class thriftClass = null; + private volatile Class thriftClass = null; @JsonCreator public ThriftInputRowParser( diff --git a/extensions-contrib/virtual-columns/src/main/java/io/druid/segment/MapVirtualColumn.java b/extensions-contrib/virtual-columns/src/main/java/io/druid/segment/MapVirtualColumn.java index c17b219a038..98ea69b61d1 100644 --- a/extensions-contrib/virtual-columns/src/main/java/io/druid/segment/MapVirtualColumn.java +++ b/extensions-contrib/virtual-columns/src/main/java/io/druid/segment/MapVirtualColumn.java @@ -163,7 +163,7 @@ public class MapVirtualColumn implements VirtualColumn } } - private static abstract class MapVirtualColumnValueSelector implements ColumnValueSelector + private abstract static class MapVirtualColumnValueSelector implements ColumnValueSelector { final DimensionSelector keySelector; final DimensionSelector valueSelector; diff --git a/extensions-core/datasketches/src/main/java/io/druid/query/aggregation/datasketches/theta/SketchEstimateWithErrorBounds.java b/extensions-core/datasketches/src/main/java/io/druid/query/aggregation/datasketches/theta/SketchEstimateWithErrorBounds.java index cacc548cc6b..566063731e3 100644 --- a/extensions-core/datasketches/src/main/java/io/druid/query/aggregation/datasketches/theta/SketchEstimateWithErrorBounds.java +++ b/extensions-core/datasketches/src/main/java/io/druid/query/aggregation/datasketches/theta/SketchEstimateWithErrorBounds.java @@ -27,10 +27,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ public class SketchEstimateWithErrorBounds { - final private double estimate; - final private double highBound; - final private double lowBound; - final private int numStdDev; + private final double estimate; + private final double highBound; + private final double lowBound; + private final int numStdDev; @JsonCreator public SketchEstimateWithErrorBounds( diff --git a/extensions-core/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/SketchAggregationTest.java b/extensions-core/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/SketchAggregationTest.java index 852efb65533..fc24dbbe830 100644 --- a/extensions-core/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/SketchAggregationTest.java +++ b/extensions-core/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/SketchAggregationTest.java @@ -419,7 +419,7 @@ public class SketchAggregationTest ); } - public final static String readFileFromClasspathAsString(String fileName) throws IOException + public static final String readFileFromClasspathAsString(String fileName) throws IOException { return Files.asCharSource( new File(SketchAggregationTest.class.getClassLoader().getResource(fileName).getFile()), diff --git a/extensions-core/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/SketchAggregationWithSimpleDataTest.java b/extensions-core/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/SketchAggregationWithSimpleDataTest.java index 09e78852590..3bf0e13a8d6 100644 --- a/extensions-core/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/SketchAggregationWithSimpleDataTest.java +++ b/extensions-core/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/SketchAggregationWithSimpleDataTest.java @@ -277,7 +277,7 @@ public class SketchAggregationWithSimpleDataTest Assert.assertEquals("AgMDAAAazJMCAAAAAACAPzz9j7pWTMdROWGf15uY1nI=", result.getValue().getEvents().get(0).getEvent().get("pty_country")); } - public final static String readFileFromClasspathAsString(String fileName) throws IOException + public static final String readFileFromClasspathAsString(String fileName) throws IOException { return Files.asCharSource( new File(SketchAggregationTest.class.getClassLoader().getResource(fileName).getFile()), diff --git a/extensions-core/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/oldapi/OldApiSketchAggregationTest.java b/extensions-core/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/oldapi/OldApiSketchAggregationTest.java index db745f601cd..f01efca9560 100644 --- a/extensions-core/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/oldapi/OldApiSketchAggregationTest.java +++ b/extensions-core/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/oldapi/OldApiSketchAggregationTest.java @@ -226,7 +226,7 @@ public class OldApiSketchAggregationTest ); } - public final static String readFileFromClasspathAsString(String fileName) throws IOException + public static final String readFileFromClasspathAsString(String fileName) throws IOException { return Files.asCharSource( new File(OldApiSketchAggregationTest.class.getClassLoader().getResource(fileName).getFile()), diff --git a/extensions-core/druid-basic-security/src/main/java/io/druid/security/basic/BasicAuthUtils.java b/extensions-core/druid-basic-security/src/main/java/io/druid/security/basic/BasicAuthUtils.java index 9b1f92d1603..97d184b3d1f 100644 --- a/extensions-core/druid-basic-security/src/main/java/io/druid/security/basic/BasicAuthUtils.java +++ b/extensions-core/druid-basic-security/src/main/java/io/druid/security/basic/BasicAuthUtils.java @@ -47,18 +47,18 @@ public class BasicAuthUtils private static final Logger log = new Logger(BasicAuthUtils.class); private static final SecureRandom SECURE_RANDOM = new SecureRandom(); - public final static String ADMIN_NAME = "admin"; - public final static String INTERNAL_USER_NAME = "druid_system"; + public static final String ADMIN_NAME = "admin"; + public static final String INTERNAL_USER_NAME = "druid_system"; // PBKDF2WithHmacSHA512 is chosen since it has built-in support in Java8. // Argon2 (https://github.com/p-h-c/phc-winner-argon2) is newer but the only presently // available Java binding is LGPLv3 licensed. // Key length is 512-bit to match the PBKDF2WithHmacSHA512 algorithm. // 256-bit salt should be more than sufficient for uniqueness, expected user count is on the order of thousands. - public final static int SALT_LENGTH = 32; - public final static int DEFAULT_KEY_ITERATIONS = 10000; - public final static int KEY_LENGTH = 512; - public final static String ALGORITHM = "PBKDF2WithHmacSHA512"; + public static final int SALT_LENGTH = 32; + public static final int DEFAULT_KEY_ITERATIONS = 10000; + public static final int KEY_LENGTH = 512; + public static final String ALGORITHM = "PBKDF2WithHmacSHA512"; public static final TypeReference AUTHENTICATOR_USER_MAP_TYPE_REFERENCE = new TypeReference>() diff --git a/extensions-core/druid-basic-security/src/test/java/io/druid/security/authentication/CoordinatorBasicAuthenticatorMetadataStorageUpdaterTest.java b/extensions-core/druid-basic-security/src/test/java/io/druid/security/authentication/CoordinatorBasicAuthenticatorMetadataStorageUpdaterTest.java index 3ea3b11847d..b65a3647b9e 100644 --- a/extensions-core/druid-basic-security/src/test/java/io/druid/security/authentication/CoordinatorBasicAuthenticatorMetadataStorageUpdaterTest.java +++ b/extensions-core/druid-basic-security/src/test/java/io/druid/security/authentication/CoordinatorBasicAuthenticatorMetadataStorageUpdaterTest.java @@ -56,7 +56,7 @@ import java.util.Map; public class CoordinatorBasicAuthenticatorMetadataStorageUpdaterTest { - private final static String AUTHENTICATOR_NAME = "test"; + private static final String AUTHENTICATOR_NAME = "test"; @Rule public ExpectedException expectedException = ExpectedException.none(); diff --git a/extensions-core/druid-basic-security/src/test/java/io/druid/security/authentication/CoordinatorBasicAuthenticatorResourceTest.java b/extensions-core/druid-basic-security/src/test/java/io/druid/security/authentication/CoordinatorBasicAuthenticatorResourceTest.java index 059a4816530..1bf3d54f233 100644 --- a/extensions-core/druid-basic-security/src/test/java/io/druid/security/authentication/CoordinatorBasicAuthenticatorResourceTest.java +++ b/extensions-core/druid-basic-security/src/test/java/io/druid/security/authentication/CoordinatorBasicAuthenticatorResourceTest.java @@ -62,8 +62,8 @@ import java.util.Set; public class CoordinatorBasicAuthenticatorResourceTest { - private final static String AUTHENTICATOR_NAME = "test"; - private final static String AUTHENTICATOR_NAME2 = "test2"; + private static final String AUTHENTICATOR_NAME = "test"; + private static final String AUTHENTICATOR_NAME2 = "test2"; @Rule public ExpectedException expectedException = ExpectedException.none(); diff --git a/extensions-core/druid-basic-security/src/test/java/io/druid/security/authorization/CoordinatorBasicAuthorizerMetadataStorageUpdaterTest.java b/extensions-core/druid-basic-security/src/test/java/io/druid/security/authorization/CoordinatorBasicAuthorizerMetadataStorageUpdaterTest.java index d1f6b1fb17e..76be80c694f 100644 --- a/extensions-core/druid-basic-security/src/test/java/io/druid/security/authorization/CoordinatorBasicAuthorizerMetadataStorageUpdaterTest.java +++ b/extensions-core/druid-basic-security/src/test/java/io/druid/security/authorization/CoordinatorBasicAuthorizerMetadataStorageUpdaterTest.java @@ -51,9 +51,9 @@ import java.util.Map; public class CoordinatorBasicAuthorizerMetadataStorageUpdaterTest { - private final static String AUTHORIZER_NAME = "test"; + private static final String AUTHORIZER_NAME = "test"; - private final static Map BASE_USER_MAP = ImmutableMap.of( + private static final Map BASE_USER_MAP = ImmutableMap.of( BasicAuthUtils.ADMIN_NAME, new BasicAuthorizerUser(BasicAuthUtils.ADMIN_NAME, ImmutableSet.of(BasicAuthUtils.ADMIN_NAME)), BasicAuthUtils.INTERNAL_USER_NAME, @@ -61,7 +61,7 @@ public class CoordinatorBasicAuthorizerMetadataStorageUpdaterTest BasicAuthUtils.INTERNAL_USER_NAME)) ); - private final static Map BASE_ROLE_MAP = ImmutableMap.of( + private static final Map BASE_ROLE_MAP = ImmutableMap.of( BasicAuthUtils.ADMIN_NAME, new BasicAuthorizerRole( BasicAuthUtils.ADMIN_NAME, diff --git a/extensions-core/druid-basic-security/src/test/java/io/druid/security/authorization/CoordinatorBasicAuthorizerResourceTest.java b/extensions-core/druid-basic-security/src/test/java/io/druid/security/authorization/CoordinatorBasicAuthorizerResourceTest.java index 763b1f7d5f9..1a2f42103d1 100644 --- a/extensions-core/druid-basic-security/src/test/java/io/druid/security/authorization/CoordinatorBasicAuthorizerResourceTest.java +++ b/extensions-core/druid-basic-security/src/test/java/io/druid/security/authorization/CoordinatorBasicAuthorizerResourceTest.java @@ -59,8 +59,8 @@ import java.util.Set; public class CoordinatorBasicAuthorizerResourceTest { - private final static String AUTHORIZER_NAME = "test"; - private final static String AUTHORIZER_NAME2 = "test2"; + private static final String AUTHORIZER_NAME = "test"; + private static final String AUTHORIZER_NAME2 = "test2"; @Rule public ExpectedException expectedException = ExpectedException.none(); diff --git a/extensions-core/kafka-indexing-service/src/test/java/io/druid/indexing/kafka/test/TestBroker.java b/extensions-core/kafka-indexing-service/src/test/java/io/druid/indexing/kafka/test/TestBroker.java index 598cb5a21a6..782839065f3 100644 --- a/extensions-core/kafka-indexing-service/src/test/java/io/druid/indexing/kafka/test/TestBroker.java +++ b/extensions-core/kafka-indexing-service/src/test/java/io/druid/indexing/kafka/test/TestBroker.java @@ -44,7 +44,7 @@ import java.util.Random; public class TestBroker implements Closeable { - private final static Random RANDOM = new Random(); + private static final Random RANDOM = new Random(); private final String zookeeperConnect; private final File directory; 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 9c28e3a6936..3519b95e138 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 @@ -35,7 +35,7 @@ import java.util.concurrent.atomic.AtomicBoolean; @JsonTypeName("loadingLookup") public class LoadingLookupFactory implements LookupExtractorFactory { - private final static Logger LOGGER = new Logger(LoadingLookupFactory.class); + private static final Logger LOGGER = new Logger(LoadingLookupFactory.class); @JsonProperty("dataFetcher") private final DataFetcher dataFetcher; diff --git a/extensions-core/lookups-cached-single/src/main/java/io/druid/server/lookup/cache/loading/OnHeapLoadingCache.java b/extensions-core/lookups-cached-single/src/main/java/io/druid/server/lookup/cache/loading/OnHeapLoadingCache.java index 79b888712fa..a399f27b7c0 100644 --- a/extensions-core/lookups-cached-single/src/main/java/io/druid/server/lookup/cache/loading/OnHeapLoadingCache.java +++ b/extensions-core/lookups-cached-single/src/main/java/io/druid/server/lookup/cache/loading/OnHeapLoadingCache.java @@ -36,7 +36,7 @@ import java.util.concurrent.atomic.AtomicBoolean; public class OnHeapLoadingCache implements LoadingCache { - private final static Logger log = new Logger(OnHeapLoadingCache.class); + private static final Logger log = new Logger(OnHeapLoadingCache.class); private static final int DEFAULT_INITIAL_CAPACITY = 16; //See com.google.common.cache.CacheBuilder#DEFAULT_CONCURRENCY_LEVEL private static final int DEFAULT_CONCURRENCY_LEVEL = 4; diff --git a/hll/src/main/java/io/druid/hll/HyperLogLogCollector.java b/hll/src/main/java/io/druid/hll/HyperLogLogCollector.java index 1c30f2227c9..bb26587abaa 100644 --- a/hll/src/main/java/io/druid/hll/HyperLogLogCollector.java +++ b/hll/src/main/java/io/druid/hll/HyperLogLogCollector.java @@ -69,7 +69,7 @@ public abstract class HyperLogLogCollector implements Comparable { protected volatile HadoopDruidIndexerConfig config = null; diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerMapper.java b/indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerMapper.java index dce2634454e..b5707c4fa59 100644 --- a/indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerMapper.java +++ b/indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerMapper.java @@ -111,7 +111,7 @@ public abstract class HadoopDruidIndexerMapper extends Mapper< } } - abstract protected void innerMap(InputRow inputRow, Context context, boolean reportParseExceptions) + protected abstract void innerMap(InputRow inputRow, Context context, boolean reportParseExceptions) throws IOException, InterruptedException; } diff --git a/indexing-hadoop/src/test/java/io/druid/indexer/IndexGeneratorJobTest.java b/indexing-hadoop/src/test/java/io/druid/indexer/IndexGeneratorJobTest.java index 8ed853bef99..770d8109232 100644 --- a/indexing-hadoop/src/test/java/io/druid/indexer/IndexGeneratorJobTest.java +++ b/indexing-hadoop/src/test/java/io/druid/indexer/IndexGeneratorJobTest.java @@ -80,12 +80,12 @@ import java.util.Map; @RunWith(Parameterized.class) public class IndexGeneratorJobTest { - final private static AggregatorFactory[] aggs1 = { + private static final AggregatorFactory[] aggs1 = { new LongSumAggregatorFactory("visited_num", "visited_num"), new HyperUniquesAggregatorFactory("unique_hosts", "host") }; - final private static AggregatorFactory[] aggs2 = { + private static final AggregatorFactory[] aggs2 = { new CountAggregatorFactory("count") }; diff --git a/indexing-service/src/main/java/io/druid/indexing/common/task/HadoopTask.java b/indexing-service/src/main/java/io/druid/indexing/common/task/HadoopTask.java index fad52b0ff69..63360549b5e 100644 --- a/indexing-service/src/main/java/io/druid/indexing/common/task/HadoopTask.java +++ b/indexing-service/src/main/java/io/druid/indexing/common/task/HadoopTask.java @@ -51,7 +51,7 @@ public abstract class HadoopTask extends AbstractTask private static final Logger log = new Logger(HadoopTask.class); private static final ExtensionsConfig extensionsConfig; - final static Injector injector = GuiceInjectors.makeStartupInjector(); + static final Injector injector = GuiceInjectors.makeStartupInjector(); static { extensionsConfig = injector.getInstance(ExtensionsConfig.class); diff --git a/indexing-service/src/main/java/io/druid/indexing/common/task/RealtimeIndexTask.java b/indexing-service/src/main/java/io/druid/indexing/common/task/RealtimeIndexTask.java index 0a3a8b48547..fa6246a1df8 100644 --- a/indexing-service/src/main/java/io/druid/indexing/common/task/RealtimeIndexTask.java +++ b/indexing-service/src/main/java/io/druid/indexing/common/task/RealtimeIndexTask.java @@ -87,7 +87,7 @@ public class RealtimeIndexTask extends AbstractTask public static final String CTX_KEY_LOOKUP_TIER = "lookupTier"; private static final EmittingLogger log = new EmittingLogger(RealtimeIndexTask.class); - private final static Random random = new Random(); + private static final Random random = new Random(); private static String makeTaskId(FireDepartment fireDepartment) { diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskLockbox.java b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskLockbox.java index ef478256d57..6cc3d570f4b 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskLockbox.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskLockbox.java @@ -863,8 +863,8 @@ public class TaskLockbox static class TaskLockPosse { - final private TaskLock taskLock; - final private Set taskIds; + private final TaskLock taskLock; + private final Set taskIds; TaskLockPosse(TaskLock taskLock) { diff --git a/indexing-service/src/test/java/io/druid/indexing/firehose/IngestSegmentFirehoseFactoryTest.java b/indexing-service/src/test/java/io/druid/indexing/firehose/IngestSegmentFirehoseFactoryTest.java index 3a255ea1fd5..1cc74ab12b6 100644 --- a/indexing-service/src/test/java/io/druid/indexing/firehose/IngestSegmentFirehoseFactoryTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/firehose/IngestSegmentFirehoseFactoryTest.java @@ -174,8 +174,8 @@ public class IngestSegmentFirehoseFactoryTest final IndexerSQLMetadataStorageCoordinator mdc = new IndexerSQLMetadataStorageCoordinator(null, null, null) { - final private Set published = Sets.newHashSet(); - final private Set nuked = Sets.newHashSet(); + private final Set published = Sets.newHashSet(); + private final Set nuked = Sets.newHashSet(); @Override public List getUsedSegmentsForInterval(String dataSource, Interval interval) throws IOException diff --git a/indexing-service/src/test/java/io/druid/indexing/overlord/autoscaling/PendingTaskBasedProvisioningStrategyTest.java b/indexing-service/src/test/java/io/druid/indexing/overlord/autoscaling/PendingTaskBasedProvisioningStrategyTest.java index e6afde25818..3713b00cf1f 100644 --- a/indexing-service/src/test/java/io/druid/indexing/overlord/autoscaling/PendingTaskBasedProvisioningStrategyTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/overlord/autoscaling/PendingTaskBasedProvisioningStrategyTest.java @@ -68,8 +68,8 @@ public class PendingTaskBasedProvisioningStrategyTest private PendingTaskBasedWorkerProvisioningStrategy strategy; private AtomicReference workerConfig; private ScheduledExecutorService executorService = Execs.scheduledSingleThreaded("test service"); - private final static String MIN_VERSION = "2014-01-00T00:01:00Z"; - private final static String INVALID_VERSION = "0"; + private static final String MIN_VERSION = "2014-01-00T00:01:00Z"; + private static final String INVALID_VERSION = "0"; @Before public void setUp() throws Exception diff --git a/indexing-service/src/test/java/io/druid/indexing/test/TestIndexerMetadataStorageCoordinator.java b/indexing-service/src/test/java/io/druid/indexing/test/TestIndexerMetadataStorageCoordinator.java index a89a3315b92..4c19a4c6d79 100644 --- a/indexing-service/src/test/java/io/druid/indexing/test/TestIndexerMetadataStorageCoordinator.java +++ b/indexing-service/src/test/java/io/druid/indexing/test/TestIndexerMetadataStorageCoordinator.java @@ -36,9 +36,9 @@ import java.util.Set; public class TestIndexerMetadataStorageCoordinator implements IndexerMetadataStorageCoordinator { - final private Set published = Sets.newConcurrentHashSet(); - final private Set nuked = Sets.newConcurrentHashSet(); - final private List unusedSegments; + private final Set published = Sets.newConcurrentHashSet(); + private final Set nuked = Sets.newConcurrentHashSet(); + private final List unusedSegments; public TestIndexerMetadataStorageCoordinator() { diff --git a/integration-tests/src/main/java/io/druid/testing/ConfigFileConfigProvider.java b/integration-tests/src/main/java/io/druid/testing/ConfigFileConfigProvider.java index aee84778371..9b9b1dfcb05 100644 --- a/integration-tests/src/main/java/io/druid/testing/ConfigFileConfigProvider.java +++ b/integration-tests/src/main/java/io/druid/testing/ConfigFileConfigProvider.java @@ -32,7 +32,7 @@ import java.util.Map; public class ConfigFileConfigProvider implements IntegrationTestingConfigProvider { - private final static Logger LOG = new Logger(ConfigFileConfigProvider.class); + private static final Logger LOG = new Logger(ConfigFileConfigProvider.class); private String routerUrl; private String brokerUrl; private String historicalUrl; diff --git a/integration-tests/src/main/java/io/druid/testing/clients/OverlordResourceTestClient.java b/integration-tests/src/main/java/io/druid/testing/clients/OverlordResourceTestClient.java index 82e5456abcc..b0beedea5f2 100644 --- a/integration-tests/src/main/java/io/druid/testing/clients/OverlordResourceTestClient.java +++ b/integration-tests/src/main/java/io/druid/testing/clients/OverlordResourceTestClient.java @@ -49,7 +49,7 @@ import java.util.concurrent.Callable; public class OverlordResourceTestClient { - private final static Logger LOG = new Logger(OverlordResourceTestClient.class); + private static final Logger LOG = new Logger(OverlordResourceTestClient.class); private final ObjectMapper jsonMapper; private final HttpClient httpClient; private final String indexer; diff --git a/processing/src/main/java/io/druid/query/DruidMetrics.java b/processing/src/main/java/io/druid/query/DruidMetrics.java index 7ef26d3610e..0324cc1350f 100644 --- a/processing/src/main/java/io/druid/query/DruidMetrics.java +++ b/processing/src/main/java/io/druid/query/DruidMetrics.java @@ -28,19 +28,19 @@ import java.util.List; */ public class DruidMetrics { - public final static String DATASOURCE = "dataSource"; - public final static String TYPE = "type"; - public final static String INTERVAL = "interval"; - public final static String ID = "id"; - public final static String TASK_ID = "taskId"; - public final static String STATUS = "status"; + public static final String DATASOURCE = "dataSource"; + public static final String TYPE = "type"; + public static final String INTERVAL = "interval"; + public static final String ID = "id"; + public static final String TASK_ID = "taskId"; + public static final String STATUS = "status"; // task metrics - public final static String TASK_TYPE = "taskType"; - public final static String TASK_STATUS = "taskStatus"; + public static final String TASK_TYPE = "taskType"; + public static final String TASK_STATUS = "taskStatus"; - public final static String SERVER = "server"; - public final static String TIER = "tier"; + public static final String SERVER = "server"; + public static final String TIER = "tier"; public static int findNumComplexAggs(List aggs) { 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 aa6261b15f7..09b4cac40d5 100644 --- a/processing/src/main/java/io/druid/query/aggregation/HistogramVisual.java +++ b/processing/src/main/java/io/druid/query/aggregation/HistogramVisual.java @@ -27,11 +27,11 @@ import java.util.Arrays; public class HistogramVisual { - @JsonProperty final public double[] breaks; + @JsonProperty public final double[] breaks; @JsonProperty - final public double[] counts; + public final double[] counts; // an array of the quantiles including the min. and max. - @JsonProperty final public double[] quantiles; + @JsonProperty public final double[] quantiles; @JsonCreator public HistogramVisual( diff --git a/processing/src/main/java/io/druid/query/filter/AndDimFilter.java b/processing/src/main/java/io/druid/query/filter/AndDimFilter.java index 7b3bc413c4f..43fd9c02642 100644 --- a/processing/src/main/java/io/druid/query/filter/AndDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/AndDimFilter.java @@ -38,7 +38,7 @@ public class AndDimFilter implements DimFilter { private static final Joiner AND_JOINER = Joiner.on(" && "); - final private List fields; + private final List fields; @JsonCreator public AndDimFilter( diff --git a/processing/src/main/java/io/druid/query/filter/NotDimFilter.java b/processing/src/main/java/io/druid/query/filter/NotDimFilter.java index dca7d1d1705..d2c220f6d99 100644 --- a/processing/src/main/java/io/druid/query/filter/NotDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/NotDimFilter.java @@ -34,7 +34,7 @@ import java.util.List; public class NotDimFilter implements DimFilter { - final private DimFilter field; + private final DimFilter field; @JsonCreator public NotDimFilter( diff --git a/processing/src/main/java/io/druid/query/filter/OrDimFilter.java b/processing/src/main/java/io/druid/query/filter/OrDimFilter.java index 622410a571b..538a80b31aa 100644 --- a/processing/src/main/java/io/druid/query/filter/OrDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/OrDimFilter.java @@ -39,7 +39,7 @@ public class OrDimFilter implements DimFilter { private static final Joiner OR_JOINER = Joiner.on(" || "); - final private List fields; + private final List fields; @JsonCreator public OrDimFilter( diff --git a/processing/src/main/java/io/druid/query/groupby/GroupByQuery.java b/processing/src/main/java/io/druid/query/groupby/GroupByQuery.java index 72fd236402b..2b8bd7f5de8 100644 --- a/processing/src/main/java/io/druid/query/groupby/GroupByQuery.java +++ b/processing/src/main/java/io/druid/query/groupby/GroupByQuery.java @@ -80,9 +80,9 @@ import java.util.stream.Collectors; */ public class GroupByQuery extends BaseQuery { - public final static String CTX_KEY_SORT_BY_DIMS_FIRST = "sortByDimsFirst"; + public static final String CTX_KEY_SORT_BY_DIMS_FIRST = "sortByDimsFirst"; - private final static Comparator NON_GRANULAR_TIME_COMP = (Row lhs, Row rhs) -> Longs.compare( + private static final Comparator NON_GRANULAR_TIME_COMP = (Row lhs, Row rhs) -> Longs.compare( lhs.getTimestampFromEpoch(), rhs.getTimestampFromEpoch() ); diff --git a/processing/src/main/java/io/druid/query/groupby/GroupByQueryHelper.java b/processing/src/main/java/io/druid/query/groupby/GroupByQueryHelper.java index 1d2fb7b7151..f8b070d9e96 100644 --- a/processing/src/main/java/io/druid/query/groupby/GroupByQueryHelper.java +++ b/processing/src/main/java/io/druid/query/groupby/GroupByQueryHelper.java @@ -55,7 +55,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; public class GroupByQueryHelper { - public final static String CTX_KEY_SORT_RESULTS = "sortResults"; + public static final String CTX_KEY_SORT_RESULTS = "sortResults"; public static Pair> createIndexAccumulatorPair( final GroupByQuery query, diff --git a/processing/src/main/java/io/druid/query/topn/BaseTopNAlgorithm.java b/processing/src/main/java/io/druid/query/topn/BaseTopNAlgorithm.java index c6ec6b71e86..01baeb61f7f 100644 --- a/processing/src/main/java/io/druid/query/topn/BaseTopNAlgorithm.java +++ b/processing/src/main/java/io/druid/query/topn/BaseTopNAlgorithm.java @@ -227,7 +227,7 @@ public abstract class BaseTopNAlgorithm implements TopNMetricSpecBuilder + protected abstract static class BaseArrayProvider implements TopNMetricSpecBuilder { private volatile String previousStop; private volatile boolean ignoreAfterThreshold; diff --git a/processing/src/main/java/io/druid/segment/DimensionHandlerUtils.java b/processing/src/main/java/io/druid/segment/DimensionHandlerUtils.java index c10ed586325..504e46c4f97 100644 --- a/processing/src/main/java/io/druid/segment/DimensionHandlerUtils.java +++ b/processing/src/main/java/io/druid/segment/DimensionHandlerUtils.java @@ -50,7 +50,7 @@ public final class DimensionHandlerUtils private DimensionHandlerUtils() {} - public final static ColumnCapabilities DEFAULT_STRING_CAPABILITIES = + public static final ColumnCapabilities DEFAULT_STRING_CAPABILITIES = new ColumnCapabilitiesImpl().setType(ValueType.STRING) .setDictionaryEncoded(true) .setHasBitmapIndexes(true); diff --git a/processing/src/main/java/io/druid/segment/data/CompressionStrategy.java b/processing/src/main/java/io/druid/segment/data/CompressionStrategy.java index eda99803837..73fd6c8b805 100644 --- a/processing/src/main/java/io/druid/segment/data/CompressionStrategy.java +++ b/processing/src/main/java/io/druid/segment/data/CompressionStrategy.java @@ -163,7 +163,7 @@ public enum CompressionStrategy void decompress(ByteBuffer in, int numBytes, ByteBuffer out); } - public static abstract class Compressor + public abstract static class Compressor { /** * Allocates a buffer that should be passed to {@link #compress} method as input buffer. Different Compressors diff --git a/processing/src/main/java/io/druid/segment/data/ZeroIndexedInts.java b/processing/src/main/java/io/druid/segment/data/ZeroIndexedInts.java index 4870a3ce038..cc2c126d19c 100644 --- a/processing/src/main/java/io/druid/segment/data/ZeroIndexedInts.java +++ b/processing/src/main/java/io/druid/segment/data/ZeroIndexedInts.java @@ -26,7 +26,7 @@ import io.druid.query.monomorphicprocessing.RuntimeShapeInspector; */ public class ZeroIndexedInts implements IndexedInts { - private final static ZeroIndexedInts INSTANCE = new ZeroIndexedInts(); + private static final ZeroIndexedInts INSTANCE = new ZeroIndexedInts(); private ZeroIndexedInts() { diff --git a/processing/src/test/java/io/druid/query/AsyncQueryRunnerTest.java b/processing/src/test/java/io/druid/query/AsyncQueryRunnerTest.java index d3eec4e08c8..413eb707729 100644 --- a/processing/src/test/java/io/druid/query/AsyncQueryRunnerTest.java +++ b/processing/src/test/java/io/druid/query/AsyncQueryRunnerTest.java @@ -40,7 +40,7 @@ import java.util.concurrent.TimeoutException; public class AsyncQueryRunnerTest { - private final static long TEST_TIMEOUT = 60000; + private static final long TEST_TIMEOUT = 60000; private final ExecutorService executor; private final Query query; diff --git a/processing/src/test/java/io/druid/query/QueryRunnerTestHelper.java b/processing/src/test/java/io/druid/query/QueryRunnerTestHelper.java index 0c2a781bf4f..ad54d5d46a4 100644 --- a/processing/src/test/java/io/druid/query/QueryRunnerTestHelper.java +++ b/processing/src/test/java/io/druid/query/QueryRunnerTestHelper.java @@ -201,7 +201,7 @@ public class QueryRunnerTestHelper qualityUniques ); - public final static List commonFloatAggregators = Arrays.asList( + public static final List commonFloatAggregators = Arrays.asList( new FloatSumAggregatorFactory("index", "indexFloat"), new CountAggregatorFactory("rows"), new HyperUniquesAggregatorFactory( diff --git a/processing/src/test/java/io/druid/query/aggregation/cardinality/CardinalityAggregatorBenchmark.java b/processing/src/test/java/io/druid/query/aggregation/cardinality/CardinalityAggregatorBenchmark.java index 0e8d1700dc7..f6bad6c642c 100644 --- a/processing/src/test/java/io/druid/query/aggregation/cardinality/CardinalityAggregatorBenchmark.java +++ b/processing/src/test/java/io/druid/query/aggregation/cardinality/CardinalityAggregatorBenchmark.java @@ -43,7 +43,7 @@ import java.util.List; */ public class CardinalityAggregatorBenchmark extends SimpleBenchmark { - private final static int MAX = 5_000_000; + private static final int MAX = 5_000_000; CardinalityBufferAggregator agg; List selectorList; diff --git a/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactoryTest.java b/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactoryTest.java index 0239278fee9..e041881bed6 100644 --- a/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactoryTest.java +++ b/processing/src/test/java/io/druid/query/aggregation/hyperloglog/HyperUniquesAggregatorFactoryTest.java @@ -35,11 +35,11 @@ import java.util.Random; public class HyperUniquesAggregatorFactoryTest { - final static HyperUniquesAggregatorFactory aggregatorFactory = new HyperUniquesAggregatorFactory( + static final HyperUniquesAggregatorFactory aggregatorFactory = new HyperUniquesAggregatorFactory( "hyperUnique", "uniques" ); - final static String V0_BASE64 = "AAYbEyQwFyQVASMCVFEQQgEQIxIhM4ISAQMhUkICEDFDIBMhMgFQFAFAMjAAEhEREyVAEiUBAhIjISATMCECMiERIRIiVRFRAyIAEgFCQSMEJAITATAAEAMQgCEBEjQiAyUTAyEQASJyAGURAAISAwISATETQhAREBYDIVIlFTASAzJgERIgRCcmUyAwNAMyEJMjIhQXQhEWECABQDETATEREjIRAgEyIiMxMBQiAkBBMDYAMEQQACMzMhIkMTQSkYIRABIBADMBAhIEISAENkEBQDAxETMAIEEwEzQiQSEVQSFBBAQDICIiAVIAMTAQIQYBIRABADMDEzEAQSMkEiAYFBAQI0AmECEyQSARRTIVMhEkMiKAMCUBxUghAkIBI3EmMAQiACEAJDJCAAADOzESEDBCRjMgEUQQETQwEWIhA6MlAiAAZDI1AgEIIDUyFDIHMQEEAwIRBRABBStCZCQhAgJSMQIiQEEURTBmM1MxACIAETGhMgQnBRICNiIREyIUNAEAAkABAwQSEBJBIhIhIRERAiIRACUhEUAVMkQGEVMjECYjACBwEQQSIRIgAAEyExQUFSEAIBJCIDIDYTAgMiNBIUADUiETADMoFEADETMCIwUEQkIAESMSIzIABDERIXEhIiACQgUSEgJiQCAUARIRAREDQiEUAkQgAgQiIEAzIxRCARIgBAAVAzMAECEwE0Qh8gAAASEhEiAiMhUxcRImIVABATYyUBAwIoE1QhRDIiYBIBEBEiQSQyERAAADMAARAEACFYUwQSQBIRIgURITARFSEzEHEBACOTMREBIAMjIgEhU0cxEQIRIhIi1wEgMRUBEgMQIRAnAVASURMHQBAiEyBSAAEBQTAWQ5EQA0IUMSISAUEiASIjIhMhMFJBBSEjEAECEwACASEQFBAjARITEQIgYTEKEAeAAiMkEyARowARFBAicRISIBIxAQAgEBARMCIRQgMSIVIAkjMxIAIEMyADASMgFRIjEyKjEjBBIEQCUAARYBEQMxMCIBACNCACRCMlEzUUAAUDM1MhAjEgAxAAISAVFQECAhQAMBMhEzEgASNxAhFRIxECMRJBQAERAToBgQMhJSRQFAEhAwMiIhMQAwAgQiBQJiIGMQQhEiQxR1MiAjIAIEEiAkARECEzQlMjECIRATBgIhEBQAIQAEATEjBCMwAgMBMhAhIyFBIxQAARI1AAEABCIDFBIRUzMBIgAgEiARQCASMQQDQCFBAQAUJwMUElAyIAIRBSIRITICEAIxMAEUBEYTcBMBEEIxMREwIRIDAGIAEgYxBAEANCAhBAI2UhIiIgIRABIEVRAwNEIQERQgEFMhFCQSIAEhQDMTEQMiAjJyEQ=="; + static final String V0_BASE64 = "AAYbEyQwFyQVASMCVFEQQgEQIxIhM4ISAQMhUkICEDFDIBMhMgFQFAFAMjAAEhEREyVAEiUBAhIjISATMCECMiERIRIiVRFRAyIAEgFCQSMEJAITATAAEAMQgCEBEjQiAyUTAyEQASJyAGURAAISAwISATETQhAREBYDIVIlFTASAzJgERIgRCcmUyAwNAMyEJMjIhQXQhEWECABQDETATEREjIRAgEyIiMxMBQiAkBBMDYAMEQQACMzMhIkMTQSkYIRABIBADMBAhIEISAENkEBQDAxETMAIEEwEzQiQSEVQSFBBAQDICIiAVIAMTAQIQYBIRABADMDEzEAQSMkEiAYFBAQI0AmECEyQSARRTIVMhEkMiKAMCUBxUghAkIBI3EmMAQiACEAJDJCAAADOzESEDBCRjMgEUQQETQwEWIhA6MlAiAAZDI1AgEIIDUyFDIHMQEEAwIRBRABBStCZCQhAgJSMQIiQEEURTBmM1MxACIAETGhMgQnBRICNiIREyIUNAEAAkABAwQSEBJBIhIhIRERAiIRACUhEUAVMkQGEVMjECYjACBwEQQSIRIgAAEyExQUFSEAIBJCIDIDYTAgMiNBIUADUiETADMoFEADETMCIwUEQkIAESMSIzIABDERIXEhIiACQgUSEgJiQCAUARIRAREDQiEUAkQgAgQiIEAzIxRCARIgBAAVAzMAECEwE0Qh8gAAASEhEiAiMhUxcRImIVABATYyUBAwIoE1QhRDIiYBIBEBEiQSQyERAAADMAARAEACFYUwQSQBIRIgURITARFSEzEHEBACOTMREBIAMjIgEhU0cxEQIRIhIi1wEgMRUBEgMQIRAnAVASURMHQBAiEyBSAAEBQTAWQ5EQA0IUMSISAUEiASIjIhMhMFJBBSEjEAECEwACASEQFBAjARITEQIgYTEKEAeAAiMkEyARowARFBAicRISIBIxAQAgEBARMCIRQgMSIVIAkjMxIAIEMyADASMgFRIjEyKjEjBBIEQCUAARYBEQMxMCIBACNCACRCMlEzUUAAUDM1MhAjEgAxAAISAVFQECAhQAMBMhEzEgASNxAhFRIxECMRJBQAERAToBgQMhJSRQFAEhAwMiIhMQAwAgQiBQJiIGMQQhEiQxR1MiAjIAIEEiAkARECEzQlMjECIRATBgIhEBQAIQAEATEjBCMwAgMBMhAhIyFBIxQAARI1AAEABCIDFBIRUzMBIgAgEiARQCASMQQDQCFBAQAUJwMUElAyIAIRBSIRITICEAIxMAEUBEYTcBMBEEIxMREwIRIDAGIAEgYxBAEANCAhBAI2UhIiIgIRABIEVRAwNEIQERQgEFMhFCQSIAEhQDMTEQMiAjJyEQ=="; private final HashFunction fn = Hashing.murmur3_128(); diff --git a/processing/src/test/java/io/druid/query/dimension/TestDimensionSelector.java b/processing/src/test/java/io/druid/query/dimension/TestDimensionSelector.java index 1613b005a85..9ad9b1fb3e1 100644 --- a/processing/src/test/java/io/druid/query/dimension/TestDimensionSelector.java +++ b/processing/src/test/java/io/druid/query/dimension/TestDimensionSelector.java @@ -37,7 +37,7 @@ import javax.annotation.Nullable; */ class TestDimensionSelector implements DimensionSelector { - public final static TestDimensionSelector instance = new TestDimensionSelector(); + public static final TestDimensionSelector instance = new TestDimensionSelector(); private TestDimensionSelector() { diff --git a/processing/src/test/java/io/druid/query/groupby/GroupByQueryMergeBufferTest.java b/processing/src/test/java/io/druid/query/groupby/GroupByQueryMergeBufferTest.java index cad2f35b7fe..95b48980216 100644 --- a/processing/src/test/java/io/druid/query/groupby/GroupByQueryMergeBufferTest.java +++ b/processing/src/test/java/io/druid/query/groupby/GroupByQueryMergeBufferTest.java @@ -176,7 +176,7 @@ public class GroupByQueryMergeBufferTest ); } - private final static TestBlockingPool mergeBufferPool = new TestBlockingPool( + private static final TestBlockingPool mergeBufferPool = new TestBlockingPool( new Supplier() { @Override diff --git a/processing/src/test/java/io/druid/query/groupby/GroupByQueryRunnerFailureTest.java b/processing/src/test/java/io/druid/query/groupby/GroupByQueryRunnerFailureTest.java index 198c22df36e..a0afd9ad643 100644 --- a/processing/src/test/java/io/druid/query/groupby/GroupByQueryRunnerFailureTest.java +++ b/processing/src/test/java/io/druid/query/groupby/GroupByQueryRunnerFailureTest.java @@ -140,7 +140,7 @@ public class GroupByQueryRunnerFailureTest ); } - private final static BlockingPool mergeBufferPool = new DefaultBlockingPool<>( + private static final BlockingPool mergeBufferPool = new DefaultBlockingPool<>( new Supplier() { @Override diff --git a/server/src/main/java/io/druid/client/BatchServerInventoryView.java b/server/src/main/java/io/druid/client/BatchServerInventoryView.java index abdeeaf2313..e1271b13bd7 100644 --- a/server/src/main/java/io/druid/client/BatchServerInventoryView.java +++ b/server/src/main/java/io/druid/client/BatchServerInventoryView.java @@ -52,10 +52,10 @@ public class BatchServerInventoryView extends AbstractCuratorServerInventoryView { private static final EmittingLogger log = new EmittingLogger(BatchServerInventoryView.class); - final private ConcurrentMap> zNodes = new ConcurrentHashMap<>(); - final private ConcurrentMap>> segmentPredicates = + private final ConcurrentMap> zNodes = new ConcurrentHashMap<>(); + private final ConcurrentMap>> segmentPredicates = new ConcurrentHashMap<>(); - final private Predicate> defaultFilter; + private final Predicate> defaultFilter; @Inject public BatchServerInventoryView( diff --git a/server/src/main/java/io/druid/client/SingleServerInventoryView.java b/server/src/main/java/io/druid/client/SingleServerInventoryView.java index ef69679be23..aa4c20dbf7c 100644 --- a/server/src/main/java/io/druid/client/SingleServerInventoryView.java +++ b/server/src/main/java/io/druid/client/SingleServerInventoryView.java @@ -46,7 +46,7 @@ public class SingleServerInventoryView extends AbstractCuratorServerInventoryVie { private static final EmittingLogger log = new EmittingLogger(SingleServerInventoryView.class); - final private ConcurrentMap>> segmentPredicates = + private final ConcurrentMap>> segmentPredicates = new ConcurrentHashMap<>(); private final Predicate> defaultFilter; diff --git a/server/src/main/java/io/druid/client/cache/Cache.java b/server/src/main/java/io/druid/client/cache/Cache.java index 7db32b1be10..2d4d6ed6b98 100644 --- a/server/src/main/java/io/druid/client/cache/Cache.java +++ b/server/src/main/java/io/druid/client/cache/Cache.java @@ -59,8 +59,8 @@ public interface Cache class NamedKey { - final public String namespace; - final public byte[] key; + public final String namespace; + public final byte[] key; public NamedKey(String namespace, byte[] key) { diff --git a/server/src/main/java/io/druid/client/cache/MemcachedCache.java b/server/src/main/java/io/druid/client/cache/MemcachedCache.java index 7cd6e10223d..8acc37e5ff7 100644 --- a/server/src/main/java/io/druid/client/cache/MemcachedCache.java +++ b/server/src/main/java/io/druid/client/cache/MemcachedCache.java @@ -80,7 +80,7 @@ public class MemcachedCache implements Cache * If some other algorithms are considered as the default algorithm instead of this one, the cache distribution for * those hash algorithms should be checked and compared using {@code CacheDistributionTest}. */ - final static HashAlgorithm MURMUR3_128 = new HashAlgorithm() + static final HashAlgorithm MURMUR3_128 = new HashAlgorithm() { final HashFunction fn = Hashing.murmur3_128(); diff --git a/server/src/main/java/io/druid/initialization/Initialization.java b/server/src/main/java/io/druid/initialization/Initialization.java index aeef72a0cb7..c0ba57dfe10 100644 --- a/server/src/main/java/io/druid/initialization/Initialization.java +++ b/server/src/main/java/io/druid/initialization/Initialization.java @@ -98,7 +98,7 @@ public class Initialization private static final Logger log = new Logger(Initialization.class); private static final ConcurrentMap loadersMap = new ConcurrentHashMap<>(); - private final static Map extensionsMap = Maps.newHashMap(); + private static final Map extensionsMap = Maps.newHashMap(); /** * @param clazz service class @@ -140,7 +140,7 @@ public class Initialization * elements in the returned collection is not specified and not guaranteed to be the same for different calls to * getFromExtensions(). */ - public synchronized static Collection getFromExtensions(ExtensionsConfig config, Class serviceClass) + public static synchronized Collection getFromExtensions(ExtensionsConfig config, Class serviceClass) { Collection modulesToLoad = new ServiceLoadingFromExtensions<>(config, serviceClass).implsToLoad; extensionsMap.put(serviceClass, modulesToLoad); diff --git a/server/src/main/java/io/druid/query/lookup/MapLookupExtractorFactory.java b/server/src/main/java/io/druid/query/lookup/MapLookupExtractorFactory.java index 77b80df3a1f..501086ca24c 100644 --- a/server/src/main/java/io/druid/query/lookup/MapLookupExtractorFactory.java +++ b/server/src/main/java/io/druid/query/lookup/MapLookupExtractorFactory.java @@ -122,7 +122,7 @@ public class MapLookupExtractorFactory implements LookupExtractorFactory public static class MapLookupIntrospectionHandler implements LookupIntrospectHandler { - final private Map map; + private final Map map; public MapLookupIntrospectionHandler(Map map) { this.map = map; diff --git a/server/src/main/java/io/druid/server/coordination/SegmentLoadDropHandler.java b/server/src/main/java/io/druid/server/coordination/SegmentLoadDropHandler.java index 1e84da5e20a..ab3d0020446 100644 --- a/server/src/main/java/io/druid/server/coordination/SegmentLoadDropHandler.java +++ b/server/src/main/java/io/druid/server/coordination/SegmentLoadDropHandler.java @@ -753,8 +753,8 @@ public class SegmentLoadDropHandler implements DataSegmentChangeHandler private final STATE state; private final String failureCause; - public final static Status SUCCESS = new Status(STATE.SUCCESS, null); - public final static Status PENDING = new Status(STATE.PENDING, null); + public static final Status SUCCESS = new Status(STATE.SUCCESS, null); + public static final Status PENDING = new Status(STATE.PENDING, null); @JsonCreator Status( diff --git a/server/src/main/java/io/druid/server/coordinator/CoordinatorDynamicConfig.java b/server/src/main/java/io/druid/server/coordinator/CoordinatorDynamicConfig.java index 65bea6a5848..9a71ba30fd7 100644 --- a/server/src/main/java/io/druid/server/coordinator/CoordinatorDynamicConfig.java +++ b/server/src/main/java/io/druid/server/coordinator/CoordinatorDynamicConfig.java @@ -277,16 +277,16 @@ public class CoordinatorDynamicConfig public static class Builder { - private final static long DEFAULT_MILLIS_TO_WAIT_BEFORE_DELETING = TimeUnit.MINUTES.toMillis(15); - private final static long DEFAULT_MERGE_BYTES_LIMIT = 524288000L; - private final static int DEFAULT_MERGE_SEGMENTS_LIMIT = 100; - private final static int DEFAULT_MAX_SEGMENTS_TO_MOVE = 5; - private final static int DEFAULT_REPLICANT_LIFETIME = 15; - private final static int DEFAULT_REPLICATION_THROTTLE_LIMIT = 10; - private final static int DEFAULT_BALANCER_COMPUTE_THREADS = 1; - private final static boolean DEFAULT_EMIT_BALANCING_STATS = false; - private final static boolean DEFAULT_KILL_ALL_DATA_SOURCES = false; - private final static int DEFAULT_MAX_SEGMENTS_IN_NODE_LOADING_QUEUE = 0; + private static final long DEFAULT_MILLIS_TO_WAIT_BEFORE_DELETING = TimeUnit.MINUTES.toMillis(15); + private static final long DEFAULT_MERGE_BYTES_LIMIT = 524288000L; + private static final int DEFAULT_MERGE_SEGMENTS_LIMIT = 100; + private static final int DEFAULT_MAX_SEGMENTS_TO_MOVE = 5; + private static final int DEFAULT_REPLICANT_LIFETIME = 15; + private static final int DEFAULT_REPLICATION_THROTTLE_LIMIT = 10; + private static final int DEFAULT_BALANCER_COMPUTE_THREADS = 1; + private static final boolean DEFAULT_EMIT_BALANCING_STATS = false; + private static final boolean DEFAULT_KILL_ALL_DATA_SOURCES = false; + private static final int DEFAULT_MAX_SEGMENTS_IN_NODE_LOADING_QUEUE = 0; private Long millisToWaitBeforeDeleting; private Long mergeBytesLimit; diff --git a/server/src/main/java/io/druid/server/coordinator/helper/DruidCoordinatorSegmentKiller.java b/server/src/main/java/io/druid/server/coordinator/helper/DruidCoordinatorSegmentKiller.java index a2b05a60732..559eca21474 100644 --- a/server/src/main/java/io/druid/server/coordinator/helper/DruidCoordinatorSegmentKiller.java +++ b/server/src/main/java/io/druid/server/coordinator/helper/DruidCoordinatorSegmentKiller.java @@ -39,7 +39,7 @@ import java.util.List; */ public class DruidCoordinatorSegmentKiller implements DruidCoordinatorHelper { - private final static Logger log = new Logger(DruidCoordinatorSegmentKiller.class); + private static final Logger log = new Logger(DruidCoordinatorSegmentKiller.class); private final long period; private final long retainDuration; diff --git a/server/src/main/java/io/druid/server/initialization/jetty/JettyRequestLog.java b/server/src/main/java/io/druid/server/initialization/jetty/JettyRequestLog.java index 77a792e6877..61b5490fe91 100644 --- a/server/src/main/java/io/druid/server/initialization/jetty/JettyRequestLog.java +++ b/server/src/main/java/io/druid/server/initialization/jetty/JettyRequestLog.java @@ -29,7 +29,7 @@ import io.druid.java.util.common.logger.Logger; public class JettyRequestLog extends AbstractLifeCycle implements RequestLog { - private final static Logger logger = new Logger("io.druid.jetty.RequestLog"); + private static final Logger logger = new Logger("io.druid.jetty.RequestLog"); @Override public void log(Request request, Response response) diff --git a/server/src/main/java/io/druid/server/metrics/MonitorsConfig.java b/server/src/main/java/io/druid/server/metrics/MonitorsConfig.java index b7ba7912462..6db9cb06601 100644 --- a/server/src/main/java/io/druid/server/metrics/MonitorsConfig.java +++ b/server/src/main/java/io/druid/server/metrics/MonitorsConfig.java @@ -35,7 +35,7 @@ import java.util.Properties; */ public class MonitorsConfig { - public final static String METRIC_DIMENSION_PREFIX = "druid.metrics.emitter.dimension."; + public static final String METRIC_DIMENSION_PREFIX = "druid.metrics.emitter.dimension."; @JsonProperty("monitors") @NotNull diff --git a/server/src/main/java/io/druid/server/security/Access.java b/server/src/main/java/io/druid/server/security/Access.java index bb76b12de8f..71732b9195f 100644 --- a/server/src/main/java/io/druid/server/security/Access.java +++ b/server/src/main/java/io/druid/server/security/Access.java @@ -23,7 +23,7 @@ import io.druid.java.util.common.StringUtils; public class Access { - public final static Access OK = new Access(true); + public static final Access OK = new Access(true); private final boolean allowed; private final String message; diff --git a/server/src/main/java/io/druid/timeline/partition/NumberedShardSpec.java b/server/src/main/java/io/druid/timeline/partition/NumberedShardSpec.java index 0aca040b8de..673bed3cf6a 100644 --- a/server/src/main/java/io/druid/timeline/partition/NumberedShardSpec.java +++ b/server/src/main/java/io/druid/timeline/partition/NumberedShardSpec.java @@ -40,10 +40,10 @@ import java.util.Map; public class NumberedShardSpec implements ShardSpec { @JsonIgnore - final private int partitionNum; + private final int partitionNum; @JsonIgnore - final private int partitions; + private final int partitions; @JsonCreator public NumberedShardSpec( diff --git a/server/src/test/java/io/druid/server/coordinator/rules/PeriodDropRuleTest.java b/server/src/test/java/io/druid/server/coordinator/rules/PeriodDropRuleTest.java index 699136fc7ac..8aa2b6fc7d1 100644 --- a/server/src/test/java/io/druid/server/coordinator/rules/PeriodDropRuleTest.java +++ b/server/src/test/java/io/druid/server/coordinator/rules/PeriodDropRuleTest.java @@ -32,7 +32,7 @@ import org.junit.Test; */ public class PeriodDropRuleTest { - private final static DataSegment.Builder builder = DataSegment.builder() + private static final DataSegment.Builder builder = DataSegment.builder() .dataSource("test") .version(DateTimes.of("2012-12-31T01:00:00").toString()) .shardSpec(NoneShardSpec.instance()); diff --git a/server/src/test/java/io/druid/server/coordinator/rules/PeriodLoadRuleTest.java b/server/src/test/java/io/druid/server/coordinator/rules/PeriodLoadRuleTest.java index c3c17615755..c9ebf7d4670 100644 --- a/server/src/test/java/io/druid/server/coordinator/rules/PeriodLoadRuleTest.java +++ b/server/src/test/java/io/druid/server/coordinator/rules/PeriodLoadRuleTest.java @@ -37,7 +37,7 @@ import org.junit.Test; */ public class PeriodLoadRuleTest { - private final static DataSegment.Builder builder = DataSegment.builder() + private static final DataSegment.Builder builder = DataSegment.builder() .dataSource("test") .version(DateTimes.nowUtc().toString()) .shardSpec(NoneShardSpec.instance()); diff --git a/sql/src/main/java/io/druid/sql/calcite/rule/DruidRules.java b/sql/src/main/java/io/druid/sql/calcite/rule/DruidRules.java index 5ec46abfd01..edda0480fbe 100644 --- a/sql/src/main/java/io/druid/sql/calcite/rule/DruidRules.java +++ b/sql/src/main/java/io/druid/sql/calcite/rule/DruidRules.java @@ -129,7 +129,7 @@ public class DruidRules } } - public static abstract class DruidOuterQueryRule extends RelOptRule + public abstract static class DruidOuterQueryRule extends RelOptRule { public static RelOptRule AGGREGATE = new DruidOuterQueryRule( operand(Aggregate.class, operand(DruidRel.class, any())),