From 87b96fb1fd5dd8a33211dbb51fd35f0c908cb8dc Mon Sep 17 00:00:00 2001 From: Roman Leventov Date: Tue, 20 Nov 2018 12:42:15 +0100 Subject: [PATCH] Add checkstyle rules about imports and empty lines between members (#6543) * Add checkstyle rules about imports and empty lines between members * Add suppressions * Update Eclipse import order * Add empty line * Fix StatsDEmitter --- .../druid/common/aws/AWSClientConfig.java | 1 + .../benchmark/FilterPartitionBenchmark.java | 7 ++--- .../druid/benchmark/TimeParseBenchmark.java | 1 + .../timecompare/TimeCompareBenchmark.java | 1 + codestyle/checkstyle-suppressions.xml | 10 +++++-- codestyle/checkstyle.xml | 28 ++++++++++++++----- .../collections/DummyNonBlockingPool.java | 1 + .../data/SearchableVersionedDataFinder.java | 4 +-- .../druid/data/input/impl/SqlFirehose.java | 1 + .../input/impl/prefetch/JsonIterator.java | 1 + .../input/impl/prefetch/PrefetchConfig.java | 1 + .../apache/druid/indexer/RunnerTaskState.java | 5 +++- .../org/apache/druid/indexer/TaskInfo.java | 1 + .../druid/java/util/common/FileUtils.java | 1 + .../guava/FilteringYieldingAccumulator.java | 1 + .../java/util/common/guava/MergeIterator.java | 1 + .../druid/java/util/common/io/NativeIO.java | 6 ++-- .../emitter/core/BaseHttpEmittingConfig.java | 1 + .../util/emitter/core/HttpPostEmitter.java | 1 - .../druid/java/util/metrics/SysMonitor.java | 3 +- .../segment/loading/DataSegmentPusher.java | 1 + .../CloseableDefaultBlockingPool.java | 1 + .../collections/CloseableStupidPool.java | 1 + .../druid/common/utils/SocketUtilTest.java | 1 + .../input/impl/prefetch/JsonIteratorTest.java | 1 + .../java/util/common/StreamUtilsTest.java | 1 + .../timeline/partition/NoneShardSpecTest.java | 1 + eclipse.importorder | 12 +++----- .../metrics/AmbariMetricsEmitterModule.java | 3 +- .../rocketmq/RocketMQDruidModule.java | 1 + .../rocketmq/RocketMQFirehoseFactory.java | 1 + .../graphite/GraphiteEmitterModule.java | 1 + .../input/influx/InfluxExtensionsModule.java | 1 + .../data/input/influx/InfluxParseSpec.java | 1 + .../druid/data/input/influx/InfluxParser.java | 1 + ...fkaEightSimpleConsumerFirehoseFactory.java | 1 - .../DatasourceOptimizerTest.java | 1 + .../data/input/orc/OrcExtensionsModule.java | 1 + .../input/orc/OrcHadoopInputRowParser.java | 1 + .../input/orc/DruidOrcInputFormatTest.java | 1 + .../input/orc/OrcIndexGeneratorJobTest.java | 1 + .../rabbitmq/RabbitMQDruidModule.java | 1 + .../storage/sqlserver/SQLServerConnector.java | 1 + .../SQLServerMetadataStorageModule.java | 1 + .../CustomStatementRewriterTest.java | 1 + .../sqlserver/SQLServerConnectorTest.java | 1 + .../emitter/statsd/DimensionConverter.java | 2 ++ .../druid/emitter/statsd/StatsDEmitter.java | 6 ++-- .../input/thrift/ThriftDeserialization.java | 1 + .../aggregation/TimestampMinMaxModule.java | 1 + ...TypeMapVirtualColumnDimensionSelector.java | 1 + .../MapVirtualColumnDimensionSelector.java | 1 + .../MapVirtualColumnValueSelector.java | 1 + ...TypeMapVirtualColumnDimensionSelector.java | 1 + .../segment/MapVirtualColumnGroupByTest.java | 1 + .../segment/MapVirtualColumnTestBase.java | 1 + .../segment/MapVirtualColumnTopNTest.java | 1 + .../data/input/AvroHadoopInputRowParser.java | 1 + .../data/input/AvroStreamInputRowParser.java | 1 + .../data/input/avro/AvroBytesDecoder.java | 1 + .../data/input/avro/AvroExtensionsModule.java | 1 + .../data/input/avro/AvroValueInputFormat.java | 1 + .../input/avro/AvroValueRecordReader.java | 1 + .../SchemaRegistryBasedAvroBytesDecoder.java | 1 + .../avro/SchemaRepoBasedAvroBytesDecoder.java | 1 + .../Avro1124RESTRepositoryClientWrapper.java | 1 + .../Avro1124SubjectAndIdConverter.java | 1 + .../schemarepo/SubjectAndIdConverter.java | 1 + .../input/AvroHadoopInputRowParserTest.java | 1 + .../input/AvroStreamInputRowParserTest.java | 1 + .../hll/HllSketchBuildAggregator.java | 1 - .../hll/HllSketchBuildAggregatorFactory.java | 5 ++-- .../hll/HllSketchBuildBufferAggregator.java | 19 ++++++------- .../hll/HllSketchJsonSerializer.java | 4 +-- .../hll/HllSketchMergeAggregator.java | 3 +- .../hll/HllSketchMergeAggregatorFactory.java | 5 ++-- .../hll/HllSketchMergeBufferAggregator.java | 11 ++++---- .../datasketches/hll/HllSketchModule.java | 7 ++--- .../hll/HllSketchObjectStrategy.java | 7 ++--- ...tchToEstimateWithBoundsPostAggregator.java | 4 +-- .../hll/HllSketchToStringPostAggregator.java | 1 - .../DoublesSketchObjectStrategy.java | 1 - .../theta/SketchEstimatePostAggregator.java | 1 + .../theta/SketchEstimateWithErrorBounds.java | 1 + .../datasketches/hll/GenerateTestData.java | 11 ++++---- .../SketchEstimateWithErrorBoundsTest.java | 1 + .../guice/BloomFilterSerializersModule.java | 1 + .../security/kerberos/KerberosEscalator.java | 2 +- .../hdfs/HdfsFileTimestampVersionFinder.java | 4 --- .../storage/hdfs/tasklog/HdfsTaskLogs.java | 1 + .../hdfs/tasklog/HdfsTaskLogsConfig.java | 1 + .../org/apache/hadoop/fs/HadoopFsWrapper.java | 4 +-- ...ementalPublishingKafkaIndexTaskRunner.java | 1 + .../indexing/kafka/KafkaIndexTaskRunner.java | 1 + .../kafka/LegacyKafkaIndexTaskRunner.java | 1 + .../lookup/namespace/UriCacheGenerator.java | 2 -- .../server/lookup/PollingLookupTest.java | 1 + .../sql/MySQLFirehoseDatabaseConnector.java | 1 + .../avro/DruidParquetAvroInputFormat.java | 1 + .../avro/ParquetAvroHadoopInputRowParser.java | 1 + .../avro/DruidParquetAvroReadSupport.java | 6 ++-- .../s3/CustomServerSideEncryption.java | 1 + .../storage/s3/KmsServerSideEncryption.java | 1 + .../storage/s3/NoopServerSideEncryption.java | 1 + .../druid/storage/s3/S3SSECustomConfig.java | 1 + .../druid/storage/s3/S3SSEKmsConfig.java | 1 + .../storage/s3/S3ServerSideEncryption.java | 1 + .../druid/storage/s3/S3StorageConfig.java | 1 + .../s3/S3TimestampVersionedDataFinder.java | 4 --- .../s3/ServerSideEncryptingAmazonS3.java | 1 + .../storage/s3/ServerSideEncryption.java | 1 + .../hll/HyperLogLogSerdeBenchmarkTest.java | 2 ++ .../druid/indexer/HadoopTuningConfig.java | 1 - .../indexer/HadoopDruidIndexerConfigTest.java | 2 +- .../guice/IndexingServiceModuleHelper.java | 1 + .../common/actions/TaskAuditLogConfig.java | 1 + .../RealtimeAppenderatorIngestionSpec.java | 1 + .../RealtimeAppenderatorTuningConfig.java | 1 + .../parallel/ParallelIndexingProgress.java | 1 + .../SinglePhaseParallelIndexingProgress.java | 1 + .../task/batch/parallel/TaskHistory.java | 1 + .../indexing/overlord/WorkerTaskRunner.java | 1 + .../indexing/overlord/TaskLockboxTest.java | 2 +- .../supervisor/SupervisorManagerTest.java | 1 + .../guice/ITTLSCertificateCheckerModule.java | 1 - .../org/testng/DruidTestRunnerFactory.java | 5 +--- .../AbstractITRealtimeIndexTaskTest.java | 1 + ...penderatorDriverRealtimeIndexTaskTest.java | 1 + .../indexer/ITNestedQueryPushDownTest.java | 1 + pom.xml | 6 ++-- .../bitmap/RoaringBitmapFactory.java | 1 + .../apache/druid/query/LegacyDataSource.java | 1 + .../druid/query/SubqueryQueryRunner.java | 2 +- .../apache/druid/query/TableDataSource.java | 1 + .../PrefixFilteredDimensionSpec.java | 7 +++-- .../druid/query/filter/SpatialDimFilter.java | 1 + ...ngStringGroupByColumnSelectorStrategy.java | 1 + .../SpecializationService.java | 1 + .../apache/druid/query/scan/ScanQuery.java | 1 + .../druid/query/scan/ScanQueryEngine.java | 1 + .../query/scan/ScanQueryLimitRowIterator.java | 1 + .../query/scan/ScanQueryRunnerFactory.java | 1 + .../druid/query/scan/ScanResultValue.java | 1 + .../apache/druid/segment/AbstractSegment.java | 1 + .../apache/druid/segment/BitmapOffset.java | 2 +- .../QueryableIndexIndexableAdapter.java | 1 - .../druid/segment/filter/SpatialFilter.java | 1 + .../segment/serde/ComplexColumnPartSerde.java | 1 + .../serde/SpatialIndexColumnPartSupplier.java | 1 + .../apache/druid/query/DoubleStorageTest.java | 1 + .../JavaScriptAggregatorBenchmark.java | 2 +- .../CardinalityAggregatorTest.java | 19 ++++--------- .../PrefixFilteredDimensionSpecTest.java | 3 +- .../extraction/LowerExtractionFnTest.java | 1 + .../extraction/UpperExtractionFnTest.java | 1 + .../druid/query/filter/AndDimFilterTest.java | 1 + .../query/filter/InDimFilterSerDesrTest.java | 4 ++- .../groupby/GroupByQueryMergeBufferTest.java | 1 + .../groupby/NestedQueryPushDownTest.java | 1 + .../query/select/SelectQueryRunnerTest.java | 4 ++- .../query/select/SelectQuerySpecTest.java | 6 ++-- .../IndexMergerV9CompatibilityTest.java | 1 - .../segment/data/BitmapCreationBenchmark.java | 1 + .../segment/filter/FilterPartitionTest.java | 7 ++--- .../IncrementalIndexRowSizeTest.java | 1 + .../SQLFirehoseDatabaseConnector.java | 1 + .../lookup/MapLookupExtractorFactory.java | 1 + .../druid/segment/indexing/TuningConfigs.java | 1 + .../LocalFileTimestampVersionFinder.java | 8 ++---- .../realtime/firehose/SqlFirehoseFactory.java | 1 + .../server/audit/SQLAuditManagerProvider.java | 1 + .../coordination/ChangeRequestsSnapshot.java | 1 - .../coordinator/BalancerStrategyFactory.java | 1 + .../BytesAccumulatingResponseHandler.java | 1 + .../coordinator/CoordinatorDynamicConfig.java | 1 + .../CostBalancerStrategyFactory.java | 1 + ...NormalizedCostBalancerStrategyFactory.java | 1 + .../RandomBalancerStrategyFactory.java | 1 + .../server/http/OverlordProxyServlet.java | 2 +- .../initialization/TLSServerConfig.java | 1 + .../metrics/QueryCountStatsMonitor.java | 1 + .../metrics/QueryCountStatsProvider.java | 1 + .../druid/server/router/ConsistentHasher.java | 6 ++-- .../DefaultTLSCertificateCheckerModule.java | 1 - .../druid/server/security/TLSUtils.java | 1 - ...chingClusteredClientFunctionalityTest.java | 1 + .../CachingClusteredClientTestUtils.java | 1 + .../metadata/SQLMetadataConnectorTest.java | 1 + .../appenderator/AppenderatorPlumberTest.java | 1 + .../appenderator/SegmentWithStateTest.java | 1 + .../firehose/IngestSegmentFirehoseTest.java | 8 +++--- .../druid/server/QueryResourceTest.java | 2 +- .../ExceptionCapturingServiceEmitter.java | 1 + .../java/org/apache/druid/cli/MainTest.java | 3 ++ .../druid/sql/calcite/rel/SortProject.java | 1 + .../calcite/schema/SegmentMetadataHolder.java | 1 + .../sql/calcite/schema/SystemSchema.java | 1 + .../sql/calcite/schema/SystemSchemaTest.java | 1 + .../calcite/util/TestServerInventoryView.java | 5 +++- 199 files changed, 281 insertions(+), 160 deletions(-) diff --git a/aws-common/src/main/java/org/apache/druid/common/aws/AWSClientConfig.java b/aws-common/src/main/java/org/apache/druid/common/aws/AWSClientConfig.java index 7c8eb8aa130..198bae4c086 100644 --- a/aws-common/src/main/java/org/apache/druid/common/aws/AWSClientConfig.java +++ b/aws-common/src/main/java/org/apache/druid/common/aws/AWSClientConfig.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.common.aws; import com.amazonaws.services.s3.S3ClientOptions; diff --git a/benchmarks/src/main/java/org/apache/druid/benchmark/FilterPartitionBenchmark.java b/benchmarks/src/main/java/org/apache/druid/benchmark/FilterPartitionBenchmark.java index 3a6df5b7b8c..810d90ff553 100644 --- a/benchmarks/src/main/java/org/apache/druid/benchmark/FilterPartitionBenchmark.java +++ b/benchmarks/src/main/java/org/apache/druid/benchmark/FilterPartitionBenchmark.java @@ -539,14 +539,11 @@ public class FilterPartitionBenchmark private static class NoBitmapSelectorDimFilter extends SelectorDimFilter { - public NoBitmapSelectorDimFilter( - String dimension, - String value, - ExtractionFn extractionFn - ) + NoBitmapSelectorDimFilter(String dimension, String value, ExtractionFn extractionFn) { super(dimension, value, extractionFn); } + @Override public Filter toFilter() { diff --git a/benchmarks/src/main/java/org/apache/druid/benchmark/TimeParseBenchmark.java b/benchmarks/src/main/java/org/apache/druid/benchmark/TimeParseBenchmark.java index 280461a756c..474cc79df91 100644 --- a/benchmarks/src/main/java/org/apache/druid/benchmark/TimeParseBenchmark.java +++ b/benchmarks/src/main/java/org/apache/druid/benchmark/TimeParseBenchmark.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.benchmark; import com.google.common.base.Function; diff --git a/benchmarks/src/main/java/org/apache/druid/benchmark/query/timecompare/TimeCompareBenchmark.java b/benchmarks/src/main/java/org/apache/druid/benchmark/query/timecompare/TimeCompareBenchmark.java index d719fe25ff8..b27e74b8abf 100644 --- a/benchmarks/src/main/java/org/apache/druid/benchmark/query/timecompare/TimeCompareBenchmark.java +++ b/benchmarks/src/main/java/org/apache/druid/benchmark/query/timecompare/TimeCompareBenchmark.java @@ -116,6 +116,7 @@ public class TimeCompareBenchmark private int threshold; protected static final Map scriptDoubleSum = new HashMap<>(); + static { scriptDoubleSum.put("fnAggregate", "function aggregate(current, a) { return current + a }"); scriptDoubleSum.put("fnReset", "function reset() { return 0 }"); diff --git a/codestyle/checkstyle-suppressions.xml b/codestyle/checkstyle-suppressions.xml index c1d9d3deca6..bf5087c9b00 100644 --- a/codestyle/checkstyle-suppressions.xml +++ b/codestyle/checkstyle-suppressions.xml @@ -20,8 +20,8 @@ --> + "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" + "https://checkstyle.org/dtds/suppressions_1_2.dtd"> @@ -56,4 +56,10 @@ + + + + + + diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml index 1acafcd65ea..16e8c14c8c7 100644 --- a/codestyle/checkstyle.xml +++ b/codestyle/checkstyle.xml @@ -29,17 +29,15 @@ - - - - - - - + + + + + @@ -96,6 +94,12 @@ + + + + + + @@ -199,6 +203,16 @@ + + + + + + + + + diff --git a/core/src/main/java/org/apache/druid/collections/DummyNonBlockingPool.java b/core/src/main/java/org/apache/druid/collections/DummyNonBlockingPool.java index cb4af45aaf6..adbdfdfc405 100644 --- a/core/src/main/java/org/apache/druid/collections/DummyNonBlockingPool.java +++ b/core/src/main/java/org/apache/druid/collections/DummyNonBlockingPool.java @@ -35,6 +35,7 @@ public final class DummyNonBlockingPool implements NonBlockingPool private DummyNonBlockingPool() { } + @Override public ResourceHolder take() { diff --git a/core/src/main/java/org/apache/druid/data/SearchableVersionedDataFinder.java b/core/src/main/java/org/apache/druid/data/SearchableVersionedDataFinder.java index 589708cf480..9033762595b 100644 --- a/core/src/main/java/org/apache/druid/data/SearchableVersionedDataFinder.java +++ b/core/src/main/java/org/apache/druid/data/SearchableVersionedDataFinder.java @@ -27,8 +27,8 @@ import java.util.regex.Pattern; * date version of data given a base descriptor and a matching pattern. "Version" is completely dependent on the * implementation but is commonly equal to the "last modified" timestamp. * - * This is implemented explicitly for URIExtractionNamespaceFunctionFactory - * If you have a use case for this interface beyond URIExtractionNamespaceFunctionFactory please bring it up in the dev list. + * This is implemented explicitly for org.apache.druid.query.lookup.namespace.CacheGenerator + * If you have a use case for this interface beyond CacheGenerator please bring it up in the dev list. * * @param The containing type for the data. A simple example would be URI */ diff --git a/core/src/main/java/org/apache/druid/data/input/impl/SqlFirehose.java b/core/src/main/java/org/apache/druid/data/input/impl/SqlFirehose.java index bda4a84cc77..3a11a95ca64 100644 --- a/core/src/main/java/org/apache/druid/data/input/impl/SqlFirehose.java +++ b/core/src/main/java/org/apache/druid/data/input/impl/SqlFirehose.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.impl; import com.google.common.collect.Iterators; diff --git a/core/src/main/java/org/apache/druid/data/input/impl/prefetch/JsonIterator.java b/core/src/main/java/org/apache/druid/data/input/impl/prefetch/JsonIterator.java index 142938b37e3..7c67556ed85 100644 --- a/core/src/main/java/org/apache/druid/data/input/impl/prefetch/JsonIterator.java +++ b/core/src/main/java/org/apache/druid/data/input/impl/prefetch/JsonIterator.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.impl.prefetch; import com.fasterxml.jackson.core.JsonParser; diff --git a/core/src/main/java/org/apache/druid/data/input/impl/prefetch/PrefetchConfig.java b/core/src/main/java/org/apache/druid/data/input/impl/prefetch/PrefetchConfig.java index 354aeb9cf55..4ee66459c22 100644 --- a/core/src/main/java/org/apache/druid/data/input/impl/prefetch/PrefetchConfig.java +++ b/core/src/main/java/org/apache/druid/data/input/impl/prefetch/PrefetchConfig.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.impl.prefetch; import java.util.concurrent.TimeUnit; diff --git a/core/src/main/java/org/apache/druid/indexer/RunnerTaskState.java b/core/src/main/java/org/apache/druid/indexer/RunnerTaskState.java index 221c49fe84b..b7a28cb2825 100644 --- a/core/src/main/java/org/apache/druid/indexer/RunnerTaskState.java +++ b/core/src/main/java/org/apache/druid/indexer/RunnerTaskState.java @@ -16,9 +16,12 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.indexer; + /** - * This includes the state of a task in the task runner not covered by {@link TaskState}, this state is not stored in database + * This includes the state of a task in the task runner not covered by {@link TaskState}, this state is not stored + * in database */ public enum RunnerTaskState { diff --git a/core/src/main/java/org/apache/druid/indexer/TaskInfo.java b/core/src/main/java/org/apache/druid/indexer/TaskInfo.java index 5be8099179a..411d87af6a9 100644 --- a/core/src/main/java/org/apache/druid/indexer/TaskInfo.java +++ b/core/src/main/java/org/apache/druid/indexer/TaskInfo.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.indexer; import com.google.common.base.Preconditions; diff --git a/core/src/main/java/org/apache/druid/java/util/common/FileUtils.java b/core/src/main/java/org/apache/druid/java/util/common/FileUtils.java index 27af2697639..97ac6cb51ad 100644 --- a/core/src/main/java/org/apache/druid/java/util/common/FileUtils.java +++ b/core/src/main/java/org/apache/druid/java/util/common/FileUtils.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.java.util.common; import com.google.common.base.Predicate; diff --git a/core/src/main/java/org/apache/druid/java/util/common/guava/FilteringYieldingAccumulator.java b/core/src/main/java/org/apache/druid/java/util/common/guava/FilteringYieldingAccumulator.java index 164af652823..5faee68f7cd 100644 --- a/core/src/main/java/org/apache/druid/java/util/common/guava/FilteringYieldingAccumulator.java +++ b/core/src/main/java/org/apache/druid/java/util/common/guava/FilteringYieldingAccumulator.java @@ -20,6 +20,7 @@ package org.apache.druid.java.util.common.guava; import com.google.common.base.Predicate; + /** */ public class FilteringYieldingAccumulator extends YieldingAccumulator diff --git a/core/src/main/java/org/apache/druid/java/util/common/guava/MergeIterator.java b/core/src/main/java/org/apache/druid/java/util/common/guava/MergeIterator.java index c12ada1fc4b..cce334c10f7 100644 --- a/core/src/main/java/org/apache/druid/java/util/common/guava/MergeIterator.java +++ b/core/src/main/java/org/apache/druid/java/util/common/guava/MergeIterator.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.java.util.common.guava; import com.google.common.collect.Iterators; diff --git a/core/src/main/java/org/apache/druid/java/util/common/io/NativeIO.java b/core/src/main/java/org/apache/druid/java/util/common/io/NativeIO.java index 9eb5d7d68f2..b087e7793fe 100644 --- a/core/src/main/java/org/apache/druid/java/util/common/io/NativeIO.java +++ b/core/src/main/java/org/apache/druid/java/util/common/io/NativeIO.java @@ -82,6 +82,7 @@ public class NativeIO } private static native int posix_fadvise(int fd, long offset, long len, int flag) throws LastErrorException; + private static native int sync_file_range(int fd, long offset, long len, int flags); private NativeIO() {} @@ -100,6 +101,7 @@ public class NativeIO return field; } + /** * Get system file descriptor (int) from FileDescriptor object. * @param descriptor - FileDescriptor object to get fd from @@ -207,9 +209,7 @@ public class NativeIO long offset = 0; long lastOffset = 0; - try ( - final RandomAccessFile raf = new RandomAccessFile(dest, "rw") - ) { + try (final RandomAccessFile raf = new RandomAccessFile(dest, "rw")) { final int fd = getfd(raf.getFD()); for (int numBytes = 0, bytesRead = 0, lastBytes = 0; bytesRead > -1;) { diff --git a/core/src/main/java/org/apache/druid/java/util/emitter/core/BaseHttpEmittingConfig.java b/core/src/main/java/org/apache/druid/java/util/emitter/core/BaseHttpEmittingConfig.java index 76e3a90e3ff..560cd63cf5b 100644 --- a/core/src/main/java/org/apache/druid/java/util/emitter/core/BaseHttpEmittingConfig.java +++ b/core/src/main/java/org/apache/druid/java/util/emitter/core/BaseHttpEmittingConfig.java @@ -32,6 +32,7 @@ public class BaseHttpEmittingConfig /** ensure the event buffers don't use more than 10% of memory by default */ public static final int DEFAULT_MAX_BATCH_SIZE; public static final int DEFAULT_BATCH_QUEUE_SIZE_LIMIT; + static { Pair batchConfigPair = getDefaultBatchSizeAndLimit(Runtime.getRuntime().maxMemory()); DEFAULT_MAX_BATCH_SIZE = batchConfigPair.lhs; diff --git a/core/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java b/core/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java index 61dc66bf4fd..8b486cb7503 100644 --- a/core/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java +++ b/core/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java @@ -739,7 +739,6 @@ public class HttpPostEmitter implements Flushable, Closeable, Emitter payloadLength = length; } - request.setHeader(HttpHeaders.Names.CONTENT_TYPE, "application/json"); request.setHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(payloadLength)); request.setBody(ByteBuffer.wrap(payload, 0, payloadLength)); diff --git a/core/src/main/java/org/apache/druid/java/util/metrics/SysMonitor.java b/core/src/main/java/org/apache/druid/java/util/metrics/SysMonitor.java index 27bc9d2cbf5..d161bc1ad05 100644 --- a/core/src/main/java/org/apache/druid/java/util/metrics/SysMonitor.java +++ b/core/src/main/java/org/apache/druid/java/util/metrics/SysMonitor.java @@ -148,7 +148,8 @@ public class SysMonitor extends FeedDefiningMonitor */ private class SwapStats implements Stats { - private long prevPageIn = 0, prevPageOut = 0; + private long prevPageIn = 0; + private long prevPageOut = 0; private SwapStats() { diff --git a/core/src/main/java/org/apache/druid/segment/loading/DataSegmentPusher.java b/core/src/main/java/org/apache/druid/segment/loading/DataSegmentPusher.java index e45538a5475..a1da4f89ec3 100644 --- a/core/src/main/java/org/apache/druid/segment/loading/DataSegmentPusher.java +++ b/core/src/main/java/org/apache/druid/segment/loading/DataSegmentPusher.java @@ -39,6 +39,7 @@ public interface DataSegmentPusher @Deprecated String getPathForHadoop(String dataSource); + String getPathForHadoop(); /** diff --git a/core/src/test/java/org/apache/druid/collections/CloseableDefaultBlockingPool.java b/core/src/test/java/org/apache/druid/collections/CloseableDefaultBlockingPool.java index bf343834a5d..5b2c10fa6e1 100644 --- a/core/src/test/java/org/apache/druid/collections/CloseableDefaultBlockingPool.java +++ b/core/src/test/java/org/apache/druid/collections/CloseableDefaultBlockingPool.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.collections; import com.google.common.base.Supplier; diff --git a/core/src/test/java/org/apache/druid/collections/CloseableStupidPool.java b/core/src/test/java/org/apache/druid/collections/CloseableStupidPool.java index 2a38a2c5cab..c18c5eb3cda 100644 --- a/core/src/test/java/org/apache/druid/collections/CloseableStupidPool.java +++ b/core/src/test/java/org/apache/druid/collections/CloseableStupidPool.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.collections; import com.google.common.base.Supplier; diff --git a/core/src/test/java/org/apache/druid/common/utils/SocketUtilTest.java b/core/src/test/java/org/apache/druid/common/utils/SocketUtilTest.java index 928d7c87996..cfb81ad671b 100644 --- a/core/src/test/java/org/apache/druid/common/utils/SocketUtilTest.java +++ b/core/src/test/java/org/apache/druid/common/utils/SocketUtilTest.java @@ -27,6 +27,7 @@ import org.junit.Test; public class SocketUtilTest { private final int MAX_PORT = 0xffff; + @Test public void testSocketUtil() { diff --git a/core/src/test/java/org/apache/druid/data/input/impl/prefetch/JsonIteratorTest.java b/core/src/test/java/org/apache/druid/data/input/impl/prefetch/JsonIteratorTest.java index 73221f194a2..bff12cc4697 100644 --- a/core/src/test/java/org/apache/druid/data/input/impl/prefetch/JsonIteratorTest.java +++ b/core/src/test/java/org/apache/druid/data/input/impl/prefetch/JsonIteratorTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.impl.prefetch; diff --git a/core/src/test/java/org/apache/druid/java/util/common/StreamUtilsTest.java b/core/src/test/java/org/apache/druid/java/util/common/StreamUtilsTest.java index 86c9235ae8e..094ca41d798 100644 --- a/core/src/test/java/org/apache/druid/java/util/common/StreamUtilsTest.java +++ b/core/src/test/java/org/apache/druid/java/util/common/StreamUtilsTest.java @@ -39,6 +39,7 @@ public class StreamUtilsTest { @Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder(); + @Test public void testRetryExceptionOnFlush() { diff --git a/core/src/test/java/org/apache/druid/timeline/partition/NoneShardSpecTest.java b/core/src/test/java/org/apache/druid/timeline/partition/NoneShardSpecTest.java index 39e3a08688b..04a519dc547 100644 --- a/core/src/test/java/org/apache/druid/timeline/partition/NoneShardSpecTest.java +++ b/core/src/test/java/org/apache/druid/timeline/partition/NoneShardSpecTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.timeline.partition; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/eclipse.importorder b/eclipse.importorder index 46db54ea9fd..cec7ef04fa6 100644 --- a/eclipse.importorder +++ b/eclipse.importorder @@ -12,11 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -# Organize Import Order -# Sun Apr 24 10:15:51 PDT 2016 -4=javax -3=java -2=org -1=io -0=com +3=\# +2=java +1=javax +0= diff --git a/extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitterModule.java b/extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitterModule.java index d85812ed3dd..4468f63d14c 100644 --- a/extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitterModule.java +++ b/extensions-contrib/ambari-metrics-emitter/src/main/java/org/apache/druid/emitter/ambari/metrics/AmbariMetricsEmitterModule.java @@ -39,10 +39,11 @@ import java.util.List; public class AmbariMetricsEmitterModule implements DruidModule { private static final String EMITTER_TYPE = "ambari-metrics"; + @Override public List getJacksonModules() { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } @Override diff --git a/extensions-contrib/druid-rocketmq/src/main/java/org/apache/druid/firehose/rocketmq/RocketMQDruidModule.java b/extensions-contrib/druid-rocketmq/src/main/java/org/apache/druid/firehose/rocketmq/RocketMQDruidModule.java index 159a3770bf4..0724a890ac4 100644 --- a/extensions-contrib/druid-rocketmq/src/main/java/org/apache/druid/firehose/rocketmq/RocketMQDruidModule.java +++ b/extensions-contrib/druid-rocketmq/src/main/java/org/apache/druid/firehose/rocketmq/RocketMQDruidModule.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.firehose.rocketmq; import com.fasterxml.jackson.databind.Module; diff --git a/extensions-contrib/druid-rocketmq/src/main/java/org/apache/druid/firehose/rocketmq/RocketMQFirehoseFactory.java b/extensions-contrib/druid-rocketmq/src/main/java/org/apache/druid/firehose/rocketmq/RocketMQFirehoseFactory.java index 945461998f7..ce78180145b 100644 --- a/extensions-contrib/druid-rocketmq/src/main/java/org/apache/druid/firehose/rocketmq/RocketMQFirehoseFactory.java +++ b/extensions-contrib/druid-rocketmq/src/main/java/org/apache/druid/firehose/rocketmq/RocketMQFirehoseFactory.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.firehose.rocketmq; import com.alibaba.rocketmq.client.Validators; diff --git a/extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/GraphiteEmitterModule.java b/extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/GraphiteEmitterModule.java index 1978b0a58be..bca977211f5 100644 --- a/extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/GraphiteEmitterModule.java +++ b/extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/GraphiteEmitterModule.java @@ -40,6 +40,7 @@ import java.util.List; public class GraphiteEmitterModule implements DruidModule { private static final String EMITTER_TYPE = "graphite"; + @Override public List getJacksonModules() { diff --git a/extensions-contrib/influx-extensions/src/main/java/org/apache/druid/data/input/influx/InfluxExtensionsModule.java b/extensions-contrib/influx-extensions/src/main/java/org/apache/druid/data/input/influx/InfluxExtensionsModule.java index 8b9ae8f1d09..da0eba6a4b6 100644 --- a/extensions-contrib/influx-extensions/src/main/java/org/apache/druid/data/input/influx/InfluxExtensionsModule.java +++ b/extensions-contrib/influx-extensions/src/main/java/org/apache/druid/data/input/influx/InfluxExtensionsModule.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.influx; import com.fasterxml.jackson.databind.Module; diff --git a/extensions-contrib/influx-extensions/src/main/java/org/apache/druid/data/input/influx/InfluxParseSpec.java b/extensions-contrib/influx-extensions/src/main/java/org/apache/druid/data/input/influx/InfluxParseSpec.java index db68fb8e4fe..025c3ad08e5 100644 --- a/extensions-contrib/influx-extensions/src/main/java/org/apache/druid/data/input/influx/InfluxParseSpec.java +++ b/extensions-contrib/influx-extensions/src/main/java/org/apache/druid/data/input/influx/InfluxParseSpec.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.influx; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-contrib/influx-extensions/src/main/java/org/apache/druid/data/input/influx/InfluxParser.java b/extensions-contrib/influx-extensions/src/main/java/org/apache/druid/data/input/influx/InfluxParser.java index a090068b1fb..a14e5e1e1cf 100644 --- a/extensions-contrib/influx-extensions/src/main/java/org/apache/druid/data/input/influx/InfluxParser.java +++ b/extensions-contrib/influx-extensions/src/main/java/org/apache/druid/data/input/influx/InfluxParser.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.influx; import com.google.common.collect.ImmutableList; diff --git a/extensions-contrib/kafka-eight-simpleConsumer/src/main/java/org/apache/druid/firehose/kafka/KafkaEightSimpleConsumerFirehoseFactory.java b/extensions-contrib/kafka-eight-simpleConsumer/src/main/java/org/apache/druid/firehose/kafka/KafkaEightSimpleConsumerFirehoseFactory.java index a68150a0273..65c501a8e54 100644 --- a/extensions-contrib/kafka-eight-simpleConsumer/src/main/java/org/apache/druid/firehose/kafka/KafkaEightSimpleConsumerFirehoseFactory.java +++ b/extensions-contrib/kafka-eight-simpleConsumer/src/main/java/org/apache/druid/firehose/kafka/KafkaEightSimpleConsumerFirehoseFactory.java @@ -97,7 +97,6 @@ public class KafkaEightSimpleConsumerFirehoseFactory implements "partitionIdList is null/empty" ); - this.clientId = clientId; Preconditions.checkArgument( clientId != null && !clientId.isEmpty(), diff --git a/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/DatasourceOptimizerTest.java b/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/DatasourceOptimizerTest.java index 73b82cd8e60..87e3d0d93cc 100644 --- a/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/DatasourceOptimizerTest.java +++ b/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/DatasourceOptimizerTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query.materializedview; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/extensions-contrib/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcExtensionsModule.java b/extensions-contrib/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcExtensionsModule.java index 9efdcd365b1..595bb3b856e 100644 --- a/extensions-contrib/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcExtensionsModule.java +++ b/extensions-contrib/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcExtensionsModule.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.orc; import com.fasterxml.jackson.databind.Module; diff --git a/extensions-contrib/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcHadoopInputRowParser.java b/extensions-contrib/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcHadoopInputRowParser.java index e31bcd88dba..6d3340ca81a 100644 --- a/extensions-contrib/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcHadoopInputRowParser.java +++ b/extensions-contrib/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcHadoopInputRowParser.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.orc; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-contrib/orc-extensions/src/test/java/org/apache/druid/data/input/orc/DruidOrcInputFormatTest.java b/extensions-contrib/orc-extensions/src/test/java/org/apache/druid/data/input/orc/DruidOrcInputFormatTest.java index 615efdbbd44..57462d2ef20 100644 --- a/extensions-contrib/orc-extensions/src/test/java/org/apache/druid/data/input/orc/DruidOrcInputFormatTest.java +++ b/extensions-contrib/orc-extensions/src/test/java/org/apache/druid/data/input/orc/DruidOrcInputFormatTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.orc; import org.apache.druid.data.input.MapBasedInputRow; diff --git a/extensions-contrib/orc-extensions/src/test/java/org/apache/druid/data/input/orc/OrcIndexGeneratorJobTest.java b/extensions-contrib/orc-extensions/src/test/java/org/apache/druid/data/input/orc/OrcIndexGeneratorJobTest.java index 6aa4715920a..fd9b9b6ee46 100644 --- a/extensions-contrib/orc-extensions/src/test/java/org/apache/druid/data/input/orc/OrcIndexGeneratorJobTest.java +++ b/extensions-contrib/orc-extensions/src/test/java/org/apache/druid/data/input/orc/OrcIndexGeneratorJobTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.orc; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/extensions-contrib/rabbitmq/src/main/java/org/apache/druid/firehose/rabbitmq/RabbitMQDruidModule.java b/extensions-contrib/rabbitmq/src/main/java/org/apache/druid/firehose/rabbitmq/RabbitMQDruidModule.java index 99565b986c2..0038c537387 100644 --- a/extensions-contrib/rabbitmq/src/main/java/org/apache/druid/firehose/rabbitmq/RabbitMQDruidModule.java +++ b/extensions-contrib/rabbitmq/src/main/java/org/apache/druid/firehose/rabbitmq/RabbitMQDruidModule.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.firehose.rabbitmq; import com.fasterxml.jackson.databind.Module; diff --git a/extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnector.java b/extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnector.java index 783daed4c8c..152501dc3c4 100644 --- a/extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnector.java +++ b/extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnector.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.metadata.storage.sqlserver; import com.google.common.base.Supplier; diff --git a/extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java b/extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java index 5ba63d4b8ef..c4ac6721782 100644 --- a/extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java +++ b/extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.metadata.storage.sqlserver; import com.fasterxml.jackson.databind.Module; diff --git a/extensions-contrib/sqlserver-metadata-storage/src/test/java/org/apache/druid/metadata/storage/sqlserver/CustomStatementRewriterTest.java b/extensions-contrib/sqlserver-metadata-storage/src/test/java/org/apache/druid/metadata/storage/sqlserver/CustomStatementRewriterTest.java index 3b71ceb9308..7dc3ae30082 100644 --- a/extensions-contrib/sqlserver-metadata-storage/src/test/java/org/apache/druid/metadata/storage/sqlserver/CustomStatementRewriterTest.java +++ b/extensions-contrib/sqlserver-metadata-storage/src/test/java/org/apache/druid/metadata/storage/sqlserver/CustomStatementRewriterTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.metadata.storage.sqlserver; import junit.framework.Assert; diff --git a/extensions-contrib/sqlserver-metadata-storage/src/test/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnectorTest.java b/extensions-contrib/sqlserver-metadata-storage/src/test/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnectorTest.java index db7bb0757fb..d061b99701d 100644 --- a/extensions-contrib/sqlserver-metadata-storage/src/test/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnectorTest.java +++ b/extensions-contrib/sqlserver-metadata-storage/src/test/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnectorTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.metadata.storage.sqlserver; import com.google.common.base.Suppliers; diff --git a/extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/DimensionConverter.java b/extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/DimensionConverter.java index ae1586a3443..0386472ded5 100644 --- a/extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/DimensionConverter.java +++ b/extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/DimensionConverter.java @@ -26,6 +26,7 @@ import com.google.common.collect.ImmutableMap; import org.apache.druid.java.util.common.ISE; import org.apache.druid.java.util.common.logger.Logger; +import javax.annotation.Nullable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -45,6 +46,7 @@ public class DimensionConverter metricMap = readMap(mapper, dimensionMapPath); } + @Nullable public StatsDMetric addFilteredUserDims( String service, String metric, diff --git a/extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/StatsDEmitter.java b/extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/StatsDEmitter.java index 7794ffee271..a36f5a09b29 100644 --- a/extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/StatsDEmitter.java +++ b/extensions-contrib/statsd-emitter/src/main/java/org/apache/druid/emitter/statsd/StatsDEmitter.java @@ -32,9 +32,9 @@ import org.apache.druid.java.util.emitter.core.Emitter; import org.apache.druid.java.util.emitter.core.Event; import org.apache.druid.java.util.emitter.service.ServiceMetricEvent; +import java.util.List; import java.util.Map; import java.util.regex.Pattern; -import java.util.List; /** */ @@ -47,7 +47,7 @@ public class StatsDEmitter implements Emitter private static final Pattern BLANK = Pattern.compile("\\s+"); private static final String[] EMPTY_ARRAY = new String[0]; - static final StatsDEmitter of(StatsDEmitterConfig config, ObjectMapper mapper) + static StatsDEmitter of(StatsDEmitterConfig config, ObjectMapper mapper) { NonBlockingStatsDClient client = new NonBlockingStatsDClient( config.getPrefix(), @@ -163,7 +163,7 @@ public class StatsDEmitter implements Emitter } } } else { - log.debug("Metric=[%s] has no StatsD type mapping", statsDMetric); + log.debug("Service=[%s], Metric=[%s] has no StatsD type mapping", service, metric); } } } diff --git a/extensions-contrib/thrift-extensions/src/main/java/org/apache/druid/data/input/thrift/ThriftDeserialization.java b/extensions-contrib/thrift-extensions/src/main/java/org/apache/druid/data/input/thrift/ThriftDeserialization.java index a0c505ce460..ae5f1f0806b 100644 --- a/extensions-contrib/thrift-extensions/src/main/java/org/apache/druid/data/input/thrift/ThriftDeserialization.java +++ b/extensions-contrib/thrift-extensions/src/main/java/org/apache/druid/data/input/thrift/ThriftDeserialization.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.thrift; import com.google.common.base.Preconditions; diff --git a/extensions-contrib/time-min-max/src/main/java/org/apache/druid/query/aggregation/TimestampMinMaxModule.java b/extensions-contrib/time-min-max/src/main/java/org/apache/druid/query/aggregation/TimestampMinMaxModule.java index 9d19299ab4b..edb6f06a050 100644 --- a/extensions-contrib/time-min-max/src/main/java/org/apache/druid/query/aggregation/TimestampMinMaxModule.java +++ b/extensions-contrib/time-min-max/src/main/java/org/apache/druid/query/aggregation/TimestampMinMaxModule.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query.aggregation; import com.fasterxml.jackson.databind.Module; diff --git a/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapTypeMapVirtualColumnDimensionSelector.java b/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapTypeMapVirtualColumnDimensionSelector.java index 45d20cb8d74..4fc361f3325 100644 --- a/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapTypeMapVirtualColumnDimensionSelector.java +++ b/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapTypeMapVirtualColumnDimensionSelector.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment; import com.google.common.base.Predicate; diff --git a/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumnDimensionSelector.java b/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumnDimensionSelector.java index 2c56df438eb..3117cf84914 100644 --- a/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumnDimensionSelector.java +++ b/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumnDimensionSelector.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment; import org.apache.druid.common.config.NullHandling; diff --git a/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumnValueSelector.java b/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumnValueSelector.java index ba25bb072ea..5c154d310d0 100644 --- a/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumnValueSelector.java +++ b/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/MapVirtualColumnValueSelector.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment; import org.apache.druid.common.config.NullHandling; diff --git a/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/StringTypeMapVirtualColumnDimensionSelector.java b/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/StringTypeMapVirtualColumnDimensionSelector.java index 9b15a29718e..37a00520369 100644 --- a/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/StringTypeMapVirtualColumnDimensionSelector.java +++ b/extensions-contrib/virtual-columns/src/main/java/org/apache/druid/segment/StringTypeMapVirtualColumnDimensionSelector.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment; import com.google.common.base.Preconditions; diff --git a/extensions-contrib/virtual-columns/src/test/java/org/apache/druid/segment/MapVirtualColumnGroupByTest.java b/extensions-contrib/virtual-columns/src/test/java/org/apache/druid/segment/MapVirtualColumnGroupByTest.java index 43d6809aa29..48ee2ef1f69 100644 --- a/extensions-contrib/virtual-columns/src/test/java/org/apache/druid/segment/MapVirtualColumnGroupByTest.java +++ b/extensions-contrib/virtual-columns/src/test/java/org/apache/druid/segment/MapVirtualColumnGroupByTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment; import com.google.common.collect.ImmutableList; diff --git a/extensions-contrib/virtual-columns/src/test/java/org/apache/druid/segment/MapVirtualColumnTestBase.java b/extensions-contrib/virtual-columns/src/test/java/org/apache/druid/segment/MapVirtualColumnTestBase.java index 7736ee246b9..ffc3706f95e 100644 --- a/extensions-contrib/virtual-columns/src/test/java/org/apache/druid/segment/MapVirtualColumnTestBase.java +++ b/extensions-contrib/virtual-columns/src/test/java/org/apache/druid/segment/MapVirtualColumnTestBase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment; import com.google.common.io.CharSource; diff --git a/extensions-contrib/virtual-columns/src/test/java/org/apache/druid/segment/MapVirtualColumnTopNTest.java b/extensions-contrib/virtual-columns/src/test/java/org/apache/druid/segment/MapVirtualColumnTopNTest.java index e2236815921..794589447c6 100644 --- a/extensions-contrib/virtual-columns/src/test/java/org/apache/druid/segment/MapVirtualColumnTopNTest.java +++ b/extensions-contrib/virtual-columns/src/test/java/org/apache/druid/segment/MapVirtualColumnTopNTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment; import com.google.common.collect.ImmutableList; diff --git a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/AvroHadoopInputRowParser.java b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/AvroHadoopInputRowParser.java index 83b27349b18..39ce48ec2b5 100644 --- a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/AvroHadoopInputRowParser.java +++ b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/AvroHadoopInputRowParser.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/AvroStreamInputRowParser.java b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/AvroStreamInputRowParser.java index 749970f6505..f375c63b8b2 100644 --- a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/AvroStreamInputRowParser.java +++ b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/AvroStreamInputRowParser.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroBytesDecoder.java b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroBytesDecoder.java index cbb6ecdca20..62448a1069c 100644 --- a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroBytesDecoder.java +++ b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroBytesDecoder.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.avro; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroExtensionsModule.java b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroExtensionsModule.java index ba14cf89059..4ffe8db99b2 100644 --- a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroExtensionsModule.java +++ b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroExtensionsModule.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.avro; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroValueInputFormat.java b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroValueInputFormat.java index e74c7f2e660..97dcd876d2e 100644 --- a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroValueInputFormat.java +++ b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroValueInputFormat.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.avro; import org.apache.avro.Schema; diff --git a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroValueRecordReader.java b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroValueRecordReader.java index 2b5090370a1..68a955fe66b 100644 --- a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroValueRecordReader.java +++ b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroValueRecordReader.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.avro; import org.apache.avro.Schema; diff --git a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/SchemaRegistryBasedAvroBytesDecoder.java b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/SchemaRegistryBasedAvroBytesDecoder.java index 0f8e4ce272d..5b9d3869556 100644 --- a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/SchemaRegistryBasedAvroBytesDecoder.java +++ b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/SchemaRegistryBasedAvroBytesDecoder.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.avro; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/SchemaRepoBasedAvroBytesDecoder.java b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/SchemaRepoBasedAvroBytesDecoder.java index 7f461a0ab31..e7de115c7b4 100644 --- a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/SchemaRepoBasedAvroBytesDecoder.java +++ b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/SchemaRepoBasedAvroBytesDecoder.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.avro; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/Avro1124RESTRepositoryClientWrapper.java b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/Avro1124RESTRepositoryClientWrapper.java index d3f32f277a5..0ba557932d6 100644 --- a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/Avro1124RESTRepositoryClientWrapper.java +++ b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/Avro1124RESTRepositoryClientWrapper.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.schemarepo; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/Avro1124SubjectAndIdConverter.java b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/Avro1124SubjectAndIdConverter.java index a18e6690fce..82f89f6a166 100644 --- a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/Avro1124SubjectAndIdConverter.java +++ b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/Avro1124SubjectAndIdConverter.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.schemarepo; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/SubjectAndIdConverter.java b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/SubjectAndIdConverter.java index 9e0751733c8..ff17010126e 100644 --- a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/SubjectAndIdConverter.java +++ b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/schemarepo/SubjectAndIdConverter.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.schemarepo; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/extensions-core/avro-extensions/src/test/java/org/apache/druid/data/input/AvroHadoopInputRowParserTest.java b/extensions-core/avro-extensions/src/test/java/org/apache/druid/data/input/AvroHadoopInputRowParserTest.java index 22f0bd78da0..dc25e8a2930 100644 --- a/extensions-core/avro-extensions/src/test/java/org/apache/druid/data/input/AvroHadoopInputRowParserTest.java +++ b/extensions-core/avro-extensions/src/test/java/org/apache/druid/data/input/AvroHadoopInputRowParserTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input; import com.fasterxml.jackson.databind.Module; diff --git a/extensions-core/avro-extensions/src/test/java/org/apache/druid/data/input/AvroStreamInputRowParserTest.java b/extensions-core/avro-extensions/src/test/java/org/apache/druid/data/input/AvroStreamInputRowParserTest.java index 4da8906c9ee..184c8b24702 100644 --- a/extensions-core/avro-extensions/src/test/java/org/apache/druid/data/input/AvroStreamInputRowParserTest.java +++ b/extensions-core/avro-extensions/src/test/java/org/apache/druid/data/input/AvroStreamInputRowParserTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input; import com.fasterxml.jackson.databind.DeserializationFeature; diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildAggregator.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildAggregator.java index 5ce5be4cb2e..f4a4e1ead05 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildAggregator.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildAggregator.java @@ -21,7 +21,6 @@ package org.apache.druid.query.aggregation.datasketches.hll; import com.yahoo.sketches.hll.HllSketch; import com.yahoo.sketches.hll.TgtHllType; - import org.apache.druid.java.util.common.IAE; import org.apache.druid.query.aggregation.Aggregator; import org.apache.druid.segment.ColumnValueSelector; diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildAggregatorFactory.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildAggregatorFactory.java index 587a6175965..edf019fe278 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildAggregatorFactory.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildAggregatorFactory.java @@ -19,19 +19,18 @@ package org.apache.druid.query.aggregation.datasketches.hll; -import javax.annotation.Nullable; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.yahoo.sketches.hll.HllSketch; import com.yahoo.sketches.hll.TgtHllType; - import org.apache.druid.query.aggregation.Aggregator; import org.apache.druid.query.aggregation.AggregatorUtil; import org.apache.druid.query.aggregation.BufferAggregator; import org.apache.druid.segment.ColumnSelectorFactory; import org.apache.druid.segment.ColumnValueSelector; +import javax.annotation.Nullable; + /** * This aggregator factory is for building sketches from raw data. * The input column can contain identifiers of type string, char[], byte[] or any numeric type. diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildBufferAggregator.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildBufferAggregator.java index bd2d047cbe9..a170502eabf 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildBufferAggregator.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildBufferAggregator.java @@ -19,22 +19,21 @@ package org.apache.druid.query.aggregation.datasketches.hll; +import com.google.common.util.concurrent.Striped; +import com.yahoo.memory.WritableMemory; +import com.yahoo.sketches.hll.HllSketch; +import com.yahoo.sketches.hll.TgtHllType; +import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; +import org.apache.druid.query.aggregation.BufferAggregator; +import org.apache.druid.segment.ColumnValueSelector; + import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.IdentityHashMap; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; -import com.google.common.util.concurrent.Striped; -import com.yahoo.memory.WritableMemory; -import com.yahoo.sketches.hll.HllSketch; -import com.yahoo.sketches.hll.TgtHllType; - -import org.apache.druid.query.aggregation.BufferAggregator; -import org.apache.druid.segment.ColumnValueSelector; -import it.unimi.dsi.fastutil.ints.Int2ObjectMap; -import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; - /** * This aggregator builds sketches from raw data. * The input column can contain identifiers of type string, char[], byte[] or any numeric type. diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchJsonSerializer.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchJsonSerializer.java index a1d753157b2..369898de4ec 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchJsonSerializer.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchJsonSerializer.java @@ -19,13 +19,13 @@ package org.apache.druid.query.aggregation.datasketches.hll; -import java.io.IOException; - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.yahoo.sketches.hll.HllSketch; +import java.io.IOException; + public class HllSketchJsonSerializer extends JsonSerializer { diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeAggregator.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeAggregator.java index bdb5a545cec..44f1157120a 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeAggregator.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeAggregator.java @@ -19,10 +19,9 @@ package org.apache.druid.query.aggregation.datasketches.hll; -import com.yahoo.sketches.hll.Union; import com.yahoo.sketches.hll.HllSketch; import com.yahoo.sketches.hll.TgtHllType; - +import com.yahoo.sketches.hll.Union; import org.apache.druid.query.aggregation.Aggregator; import org.apache.druid.segment.ColumnValueSelector; diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeAggregatorFactory.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeAggregatorFactory.java index 05da8d611f4..f1a0b1a8962 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeAggregatorFactory.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeAggregatorFactory.java @@ -19,20 +19,19 @@ package org.apache.druid.query.aggregation.datasketches.hll; -import javax.annotation.Nullable; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.yahoo.sketches.hll.HllSketch; import com.yahoo.sketches.hll.TgtHllType; import com.yahoo.sketches.hll.Union; - import org.apache.druid.query.aggregation.Aggregator; import org.apache.druid.query.aggregation.AggregatorUtil; import org.apache.druid.query.aggregation.BufferAggregator; import org.apache.druid.segment.ColumnSelectorFactory; import org.apache.druid.segment.ColumnValueSelector; +import javax.annotation.Nullable; + /** * This aggregator factory is for merging existing sketches. * The input column must contain {@link HllSketch} diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregator.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregator.java index 8e72d236911..65b273b7cad 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregator.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregator.java @@ -19,20 +19,19 @@ package org.apache.druid.query.aggregation.datasketches.hll; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReadWriteLock; - import com.google.common.util.concurrent.Striped; import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.hll.HllSketch; import com.yahoo.sketches.hll.TgtHllType; import com.yahoo.sketches.hll.Union; - import org.apache.druid.query.aggregation.BufferAggregator; import org.apache.druid.segment.ColumnValueSelector; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReadWriteLock; + /** * This aggregator merges existing sketches. * The input column must contain {@link HllSketch} diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchModule.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchModule.java index 548c4d5ee5d..983b6e150f9 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchModule.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchModule.java @@ -19,18 +19,17 @@ package org.apache.druid.query.aggregation.datasketches.hll; -import java.util.Collections; -import java.util.List; - import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.jsontype.NamedType; import com.fasterxml.jackson.databind.module.SimpleModule; import com.google.inject.Binder; import com.yahoo.sketches.hll.HllSketch; - import org.apache.druid.initialization.DruidModule; import org.apache.druid.segment.serde.ComplexMetrics; +import java.util.Collections; +import java.util.List; + /** * This module is to support count-distinct operations using {@link HllSketch}. * See HyperLogLog Sketch documentation diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchObjectStrategy.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchObjectStrategy.java index 6ae54f9e419..a3a140c0190 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchObjectStrategy.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchObjectStrategy.java @@ -19,14 +19,13 @@ package org.apache.druid.query.aggregation.datasketches.hll; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - import com.yahoo.memory.Memory; import com.yahoo.sketches.hll.HllSketch; - import org.apache.druid.segment.data.ObjectStrategy; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + public class HllSketchObjectStrategy implements ObjectStrategy { diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToEstimateWithBoundsPostAggregator.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToEstimateWithBoundsPostAggregator.java index c57341ab90c..f139456bd13 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToEstimateWithBoundsPostAggregator.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToEstimateWithBoundsPostAggregator.java @@ -22,20 +22,18 @@ package org.apache.druid.query.aggregation.datasketches.hll; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.yahoo.sketches.hll.HllSketch; - import org.apache.druid.java.util.common.IAE; import org.apache.druid.query.aggregation.AggregatorFactory; import org.apache.druid.query.aggregation.AggregatorUtil; import org.apache.druid.query.aggregation.PostAggregator; import org.apache.druid.query.cache.CacheKeyBuilder; +import javax.annotation.Nullable; import java.util.Comparator; import java.util.Map; import java.util.Objects; import java.util.Set; -import javax.annotation.Nullable; - /** * Returns a distinct count estimate and error bounds from a given {@link HllSketch}. * The result will be three double values: estimate, lower bound and upper bound. diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToStringPostAggregator.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToStringPostAggregator.java index 1da6780ef0c..19a16149ec3 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToStringPostAggregator.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchToStringPostAggregator.java @@ -22,7 +22,6 @@ package org.apache.druid.query.aggregation.datasketches.hll; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.yahoo.sketches.hll.HllSketch; - import org.apache.druid.query.aggregation.AggregatorFactory; import org.apache.druid.query.aggregation.AggregatorUtil; import org.apache.druid.query.aggregation.PostAggregator; diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchObjectStrategy.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchObjectStrategy.java index 618799d5796..38d962686c5 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchObjectStrategy.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchObjectStrategy.java @@ -22,7 +22,6 @@ package org.apache.druid.query.aggregation.datasketches.quantiles; import com.yahoo.memory.Memory; import com.yahoo.sketches.quantiles.DoublesSketch; import it.unimi.dsi.fastutil.bytes.ByteArrays; - import org.apache.druid.segment.data.ObjectStrategy; import java.nio.ByteBuffer; diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimatePostAggregator.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimatePostAggregator.java index 5bf050dbd03..b52c74df4ba 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimatePostAggregator.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimatePostAggregator.java @@ -33,6 +33,7 @@ import java.util.Comparator; import java.util.HashSet; import java.util.Map; import java.util.Set; + public class SketchEstimatePostAggregator implements PostAggregator { diff --git a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimateWithErrorBounds.java b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimateWithErrorBounds.java index 67f8302ec50..2eda00d68e5 100644 --- a/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimateWithErrorBounds.java +++ b/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimateWithErrorBounds.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query.aggregation.datasketches.theta; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/GenerateTestData.java b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/GenerateTestData.java index 489ce0ed6e2..75882ff0800 100644 --- a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/GenerateTestData.java +++ b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/GenerateTestData.java @@ -19,6 +19,9 @@ package org.apache.druid.query.aggregation.datasketches.hll; +import com.yahoo.sketches.hll.HllSketch; +import org.apache.commons.codec.binary.Base64; + import java.io.BufferedWriter; import java.nio.charset.StandardCharsets; import java.nio.file.FileSystems; @@ -27,11 +30,9 @@ import java.nio.file.Path; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; -import org.apache.commons.codec.binary.Base64; - -import com.yahoo.sketches.hll.HllSketch; - -// This is used for generating test data for HllSketchAggregatorTest +/** + * This is used for generating test data for {@link HllSketchAggregatorTest} + */ class GenerateTestData { diff --git a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimateWithErrorBoundsTest.java b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimateWithErrorBoundsTest.java index ad34fbf7c6f..7be06c4ebe3 100644 --- a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimateWithErrorBoundsTest.java +++ b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/theta/SketchEstimateWithErrorBoundsTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query.aggregation.datasketches.theta; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/guice/BloomFilterSerializersModule.java b/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/guice/BloomFilterSerializersModule.java index af4520250e3..5162abb1d05 100644 --- a/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/guice/BloomFilterSerializersModule.java +++ b/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/guice/BloomFilterSerializersModule.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.guice; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/extensions-core/druid-kerberos/src/main/java/org/apache/druid/security/kerberos/KerberosEscalator.java b/extensions-core/druid-kerberos/src/main/java/org/apache/druid/security/kerberos/KerberosEscalator.java index 87b63aed4c8..b4797e67438 100644 --- a/extensions-core/druid-kerberos/src/main/java/org/apache/druid/security/kerberos/KerberosEscalator.java +++ b/extensions-core/druid-kerberos/src/main/java/org/apache/druid/security/kerberos/KerberosEscalator.java @@ -46,8 +46,8 @@ public class KerberosEscalator implements Escalator this.authorizerName = authorizerName; this.internalClientPrincipal = internalClientPrincipal; this.internalClientKeytab = internalClientKeytab; - } + @Override public HttpClient createEscalatedClient(HttpClient baseClient) { diff --git a/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsFileTimestampVersionFinder.java b/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsFileTimestampVersionFinder.java index d89213a409a..c8560c65e68 100644 --- a/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsFileTimestampVersionFinder.java +++ b/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsFileTimestampVersionFinder.java @@ -34,10 +34,6 @@ import java.io.IOException; import java.net.URI; import java.util.regex.Pattern; -/** - * This is implemented explicitly for URIExtractionNamespaceFunctionFactory - * If you have a use case for this interface beyond URIExtractionNamespaceFunctionFactory please bring it up in the dev list. - */ public class HdfsFileTimestampVersionFinder extends HdfsDataSegmentPuller implements SearchableVersionedDataFinder { @Inject diff --git a/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/tasklog/HdfsTaskLogs.java b/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/tasklog/HdfsTaskLogs.java index 2f1df6d1fab..4e2b68fc67e 100644 --- a/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/tasklog/HdfsTaskLogs.java +++ b/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/tasklog/HdfsTaskLogs.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.storage.hdfs.tasklog; import com.google.common.base.Optional; diff --git a/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/tasklog/HdfsTaskLogsConfig.java b/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/tasklog/HdfsTaskLogsConfig.java index 820ce2637c8..01a4e0b6551 100644 --- a/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/tasklog/HdfsTaskLogsConfig.java +++ b/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/tasklog/HdfsTaskLogsConfig.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.storage.hdfs.tasklog; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-core/hdfs-storage/src/main/java/org/apache/hadoop/fs/HadoopFsWrapper.java b/extensions-core/hdfs-storage/src/main/java/org/apache/hadoop/fs/HadoopFsWrapper.java index 334a212f187..a408032aa3e 100644 --- a/extensions-core/hdfs-storage/src/main/java/org/apache/hadoop/fs/HadoopFsWrapper.java +++ b/extensions-core/hdfs-storage/src/main/java/org/apache/hadoop/fs/HadoopFsWrapper.java @@ -17,9 +17,7 @@ * under the License. */ -//CHECKSTYLE.OFF: PackageName -package org.apache.hadoop.fs; -//CHECKSTYLE.ON: PackageName +package /*CHECKSTYLE.OFF: PackageName*/org.apache.hadoop.fs/*CHECKSTYLE.ON: PackageName*/; import com.google.common.base.Throwables; import org.apache.druid.java.util.common.logger.Logger; diff --git a/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/IncrementalPublishingKafkaIndexTaskRunner.java b/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/IncrementalPublishingKafkaIndexTaskRunner.java index 57c666f1bc9..c05021df7bb 100644 --- a/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/IncrementalPublishingKafkaIndexTaskRunner.java +++ b/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/IncrementalPublishingKafkaIndexTaskRunner.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.indexing.kafka; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskRunner.java b/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskRunner.java index fd978a59387..348cfcc8c0b 100644 --- a/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskRunner.java +++ b/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTaskRunner.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.indexing.kafka; import com.google.common.annotations.VisibleForTesting; diff --git a/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/LegacyKafkaIndexTaskRunner.java b/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/LegacyKafkaIndexTaskRunner.java index 5c33efa1e52..0a4dac7fab1 100644 --- a/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/LegacyKafkaIndexTaskRunner.java +++ b/extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/LegacyKafkaIndexTaskRunner.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.indexing.kafka; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/UriCacheGenerator.java b/extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/UriCacheGenerator.java index eaa8c052e05..b7213d63af0 100644 --- a/extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/UriCacheGenerator.java +++ b/extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/UriCacheGenerator.java @@ -113,8 +113,6 @@ public final class UriCacheGenerator implements CacheGenerator { final String version = puller.getVersion(uri); diff --git a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java index c9ab212745f..ebccdbd5ee8 100644 --- a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java +++ b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java @@ -65,6 +65,7 @@ public class PollingLookupTest private static class MockDataFetcher implements DataFetcher { private int callNumber = 0; + @Override public Iterable fetchAll() { diff --git a/extensions-core/mysql-metadata-storage/src/main/java/org/apache/druid/firehose/sql/MySQLFirehoseDatabaseConnector.java b/extensions-core/mysql-metadata-storage/src/main/java/org/apache/druid/firehose/sql/MySQLFirehoseDatabaseConnector.java index 581f7ffdf76..2c08a63f8d4 100644 --- a/extensions-core/mysql-metadata-storage/src/main/java/org/apache/druid/firehose/sql/MySQLFirehoseDatabaseConnector.java +++ b/extensions-core/mysql-metadata-storage/src/main/java/org/apache/druid/firehose/sql/MySQLFirehoseDatabaseConnector.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.firehose.sql; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/avro/DruidParquetAvroInputFormat.java b/extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/avro/DruidParquetAvroInputFormat.java index 783ec983e0a..109f315c4be 100755 --- a/extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/avro/DruidParquetAvroInputFormat.java +++ b/extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/avro/DruidParquetAvroInputFormat.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.parquet.avro; import org.apache.avro.generic.GenericRecord; diff --git a/extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/avro/ParquetAvroHadoopInputRowParser.java b/extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/avro/ParquetAvroHadoopInputRowParser.java index 330d9e11f37..a297b94e5a1 100755 --- a/extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/avro/ParquetAvroHadoopInputRowParser.java +++ b/extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/avro/ParquetAvroHadoopInputRowParser.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.data.input.parquet.avro; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-core/parquet-extensions/src/main/java/org/apache/parquet/avro/DruidParquetAvroReadSupport.java b/extensions-core/parquet-extensions/src/main/java/org/apache/parquet/avro/DruidParquetAvroReadSupport.java index e8ffde7800b..9493420448d 100755 --- a/extensions-core/parquet-extensions/src/main/java/org/apache/parquet/avro/DruidParquetAvroReadSupport.java +++ b/extensions-core/parquet-extensions/src/main/java/org/apache/parquet/avro/DruidParquetAvroReadSupport.java @@ -17,9 +17,7 @@ * under the License. */ -//CHECKSTYLE.OFF: PackageName -package org.apache.parquet.avro; -//CHECKSTYLE.ON: PackageName +package /*CHECKSTYLE.OFF: PackageName*/org.apache.parquet.avro/*CHECKSTYLE.ON: PackageName*/; import org.apache.avro.Schema; import org.apache.avro.generic.GenericRecord; @@ -42,7 +40,7 @@ import java.util.Map; import java.util.Set; /** - * This class must in package org.apache.parquet.avro to access the AvroRecordMaterializer constructor + * This class must be in the package org.apache.parquet.avro to access {@link AvroRecordMaterializer}'s constructor */ public class DruidParquetAvroReadSupport extends AvroReadSupport { diff --git a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/CustomServerSideEncryption.java b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/CustomServerSideEncryption.java index d00c138b432..647ba308f2f 100644 --- a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/CustomServerSideEncryption.java +++ b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/CustomServerSideEncryption.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.storage.s3; import com.amazonaws.services.s3.model.CopyObjectRequest; diff --git a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/KmsServerSideEncryption.java b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/KmsServerSideEncryption.java index cfd2eaf3d7b..fb68f1d9f68 100644 --- a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/KmsServerSideEncryption.java +++ b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/KmsServerSideEncryption.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.storage.s3; import com.amazonaws.services.s3.model.CopyObjectRequest; diff --git a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/NoopServerSideEncryption.java b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/NoopServerSideEncryption.java index 0a30d8d54aa..b74ff32008f 100644 --- a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/NoopServerSideEncryption.java +++ b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/NoopServerSideEncryption.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.storage.s3; public class NoopServerSideEncryption implements ServerSideEncryption diff --git a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3SSECustomConfig.java b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3SSECustomConfig.java index 00c95488f08..4a970ffe2ee 100644 --- a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3SSECustomConfig.java +++ b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3SSECustomConfig.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.storage.s3; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3SSEKmsConfig.java b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3SSEKmsConfig.java index 91d1b20c6aa..6a1b35cc63f 100644 --- a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3SSEKmsConfig.java +++ b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3SSEKmsConfig.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.storage.s3; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3ServerSideEncryption.java b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3ServerSideEncryption.java index 6ca6c5e66f9..348b3d2aeab 100644 --- a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3ServerSideEncryption.java +++ b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3ServerSideEncryption.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.storage.s3; import com.amazonaws.services.s3.model.CopyObjectRequest; diff --git a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3StorageConfig.java b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3StorageConfig.java index 9881551703a..cfae0eb084b 100644 --- a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3StorageConfig.java +++ b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3StorageConfig.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.storage.s3; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TimestampVersionedDataFinder.java b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TimestampVersionedDataFinder.java index b26e4dcd357..3b7598cbe22 100644 --- a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TimestampVersionedDataFinder.java +++ b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TimestampVersionedDataFinder.java @@ -31,10 +31,6 @@ import java.net.URI; import java.util.Iterator; import java.util.regex.Pattern; -/** - * This is implemented explicitly for URIExtractionNamespaceFunctionFactory - * If you have a use case for this interface beyond URIExtractionNamespaceFunctionFactory please bring it up in the dev list. - */ public class S3TimestampVersionedDataFinder extends S3DataSegmentPuller implements SearchableVersionedDataFinder { private static final int MAX_LISTING_KEYS = 1000; diff --git a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryptingAmazonS3.java b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryptingAmazonS3.java index 577c99dfc34..f7e8fa61aa0 100644 --- a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryptingAmazonS3.java +++ b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryptingAmazonS3.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.storage.s3; import com.amazonaws.services.s3.AmazonS3; diff --git a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryption.java b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryption.java index b9a8ae8c744..3e0402d1b60 100644 --- a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryption.java +++ b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryption.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.storage.s3; import com.amazonaws.services.s3.model.CopyObjectRequest; diff --git a/hll/src/test/java/org/apache/druid/hll/HyperLogLogSerdeBenchmarkTest.java b/hll/src/test/java/org/apache/druid/hll/HyperLogLogSerdeBenchmarkTest.java index bcfa936e0f8..6658cb33b74 100644 --- a/hll/src/test/java/org/apache/druid/hll/HyperLogLogSerdeBenchmarkTest.java +++ b/hll/src/test/java/org/apache/druid/hll/HyperLogLogSerdeBenchmarkTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.hll; import com.carrotsearch.junitbenchmarks.AbstractBenchmark; @@ -47,6 +48,7 @@ public class HyperLogLogSerdeBenchmarkTest extends AbstractBenchmark { private final HyperLogLogCollector collector; private final long NUM_HASHES; + public HyperLogLogSerdeBenchmarkTest(final HyperLogLogCollector collector, Long num_hashes) { this.collector = collector; diff --git a/indexing-hadoop/src/main/java/org/apache/druid/indexer/HadoopTuningConfig.java b/indexing-hadoop/src/main/java/org/apache/druid/indexer/HadoopTuningConfig.java index 405e5d60fb1..cd110298c73 100644 --- a/indexing-hadoop/src/main/java/org/apache/druid/indexer/HadoopTuningConfig.java +++ b/indexing-hadoop/src/main/java/org/apache/druid/indexer/HadoopTuningConfig.java @@ -151,7 +151,6 @@ public class HadoopTuningConfig implements TuningConfig this.useExplicitVersion = useExplicitVersion; this.allowedHadoopPrefix = allowedHadoopPrefix == null ? ImmutableList.of() : allowedHadoopPrefix; - this.ignoreInvalidRows = ignoreInvalidRows == null ? false : ignoreInvalidRows; if (maxParseExceptions != null) { this.maxParseExceptions = maxParseExceptions; diff --git a/indexing-hadoop/src/test/java/org/apache/druid/indexer/HadoopDruidIndexerConfigTest.java b/indexing-hadoop/src/test/java/org/apache/druid/indexer/HadoopDruidIndexerConfigTest.java index 10911e70212..9161a1c55f7 100644 --- a/indexing-hadoop/src/test/java/org/apache/druid/indexer/HadoopDruidIndexerConfigTest.java +++ b/indexing-hadoop/src/test/java/org/apache/druid/indexer/HadoopDruidIndexerConfigTest.java @@ -46,12 +46,12 @@ import java.util.List; public class HadoopDruidIndexerConfigTest { private static final ObjectMapper jsonMapper; + static { jsonMapper = new DefaultObjectMapper(); jsonMapper.setInjectableValues(new InjectableValues.Std().addValue(ObjectMapper.class, jsonMapper)); } - @Test public void testHashedBucketSelection() { diff --git a/indexing-service/src/main/java/org/apache/druid/guice/IndexingServiceModuleHelper.java b/indexing-service/src/main/java/org/apache/druid/guice/IndexingServiceModuleHelper.java index be3666a3cc9..5135c97cc93 100644 --- a/indexing-service/src/main/java/org/apache/druid/guice/IndexingServiceModuleHelper.java +++ b/indexing-service/src/main/java/org/apache/druid/guice/IndexingServiceModuleHelper.java @@ -29,6 +29,7 @@ import org.apache.druid.server.initialization.IndexerZkConfig; public class IndexingServiceModuleHelper { public static final String INDEXER_RUNNER_PROPERTY_PREFIX = "druid.indexer.runner"; + public static void configureTaskRunnerConfigs(Binder binder) { JsonConfigProvider.bind(binder, INDEXER_RUNNER_PROPERTY_PREFIX, ForkingTaskRunnerConfig.class); diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskAuditLogConfig.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskAuditLogConfig.java index a4470999bff..cfabcf18a6e 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskAuditLogConfig.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/actions/TaskAuditLogConfig.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.indexing.common.actions; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/index/RealtimeAppenderatorIngestionSpec.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/index/RealtimeAppenderatorIngestionSpec.java index 9e64e1a9839..c244a0c509d 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/index/RealtimeAppenderatorIngestionSpec.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/index/RealtimeAppenderatorIngestionSpec.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.indexing.common.index; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/index/RealtimeAppenderatorTuningConfig.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/index/RealtimeAppenderatorTuningConfig.java index a5c8e7d5032..6f2052dbef7 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/index/RealtimeAppenderatorTuningConfig.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/index/RealtimeAppenderatorTuningConfig.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.indexing.common.index; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexingProgress.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexingProgress.java index edcc5950797..336bbb04bca 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexingProgress.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexingProgress.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.indexing.common.task.batch.parallel; /** diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseParallelIndexingProgress.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseParallelIndexingProgress.java index aa27767c054..28fd7c85138 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseParallelIndexingProgress.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseParallelIndexingProgress.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.indexing.common.task.batch.parallel; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/TaskHistory.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/TaskHistory.java index 48161e9cc5c..f7b1bf082fe 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/TaskHistory.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/TaskHistory.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.indexing.common.task.batch.parallel; import com.google.common.base.Preconditions; diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/WorkerTaskRunner.java b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/WorkerTaskRunner.java index 5948cbac0b7..c0620f85940 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/WorkerTaskRunner.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/WorkerTaskRunner.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.indexing.overlord; import com.google.common.base.Predicate; diff --git a/indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskLockboxTest.java b/indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskLockboxTest.java index 790e00f0846..d598b1f897b 100644 --- a/indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskLockboxTest.java +++ b/indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskLockboxTest.java @@ -695,11 +695,11 @@ public class TaskLockboxTest } private static String TASK_NAME = "myModuleIsntLoadedTask"; + private static class TheModule extends SimpleModule { public TheModule() { - registerSubtypes(new NamedType(MyModuleIsntLoadedTask.class, TASK_NAME)); } } diff --git a/indexing-service/src/test/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManagerTest.java b/indexing-service/src/test/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManagerTest.java index 7ae3b994ace..2bdddb87cef 100644 --- a/indexing-service/src/test/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManagerTest.java +++ b/indexing-service/src/test/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManagerTest.java @@ -383,6 +383,7 @@ public class SupervisorManagerTest extends EasyMockSupport this.suspended = suspended; this.suspendedSupervisor = suspendedSupervisor; } + @Override public SupervisorSpec createSuspendedSpec() { diff --git a/integration-tests/src/main/java/org/apache/druid/testing/guice/ITTLSCertificateCheckerModule.java b/integration-tests/src/main/java/org/apache/druid/testing/guice/ITTLSCertificateCheckerModule.java index f5c24a16da4..6166359693a 100644 --- a/integration-tests/src/main/java/org/apache/druid/testing/guice/ITTLSCertificateCheckerModule.java +++ b/integration-tests/src/main/java/org/apache/druid/testing/guice/ITTLSCertificateCheckerModule.java @@ -21,7 +21,6 @@ package org.apache.druid.testing.guice; import com.fasterxml.jackson.databind.Module; import com.google.inject.Binder; - import com.google.inject.name.Names; import org.apache.druid.initialization.DruidModule; import org.apache.druid.server.security.TLSCertificateChecker; diff --git a/integration-tests/src/main/java/org/testng/DruidTestRunnerFactory.java b/integration-tests/src/main/java/org/testng/DruidTestRunnerFactory.java index eb3a9bc15e6..ed53e3a512d 100644 --- a/integration-tests/src/main/java/org/testng/DruidTestRunnerFactory.java +++ b/integration-tests/src/main/java/org/testng/DruidTestRunnerFactory.java @@ -17,10 +17,7 @@ * under the License. */ - -//CHECKSTYLE.OFF: PackageName -package org.testng; -//CHECKSTYLE.ON: PackageName +package /*CHECKSTYLE.OFF: PackageName*/org.testng/*CHECKSTYLE.ON: PackageName*/; import com.google.common.base.Throwables; import com.google.inject.Injector; diff --git a/integration-tests/src/test/java/org/apache/druid/tests/indexer/AbstractITRealtimeIndexTaskTest.java b/integration-tests/src/test/java/org/apache/druid/tests/indexer/AbstractITRealtimeIndexTaskTest.java index 9bf9de219ae..176ea112590 100644 --- a/integration-tests/src/test/java/org/apache/druid/tests/indexer/AbstractITRealtimeIndexTaskTest.java +++ b/integration-tests/src/test/java/org/apache/druid/tests/indexer/AbstractITRealtimeIndexTaskTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.tests.indexer; import com.google.common.base.Throwables; diff --git a/integration-tests/src/test/java/org/apache/druid/tests/indexer/ITAppenderatorDriverRealtimeIndexTaskTest.java b/integration-tests/src/test/java/org/apache/druid/tests/indexer/ITAppenderatorDriverRealtimeIndexTaskTest.java index 54d28d9d91f..12822959b44 100644 --- a/integration-tests/src/test/java/org/apache/druid/tests/indexer/ITAppenderatorDriverRealtimeIndexTaskTest.java +++ b/integration-tests/src/test/java/org/apache/druid/tests/indexer/ITAppenderatorDriverRealtimeIndexTaskTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.tests.indexer; import com.google.common.base.Throwables; diff --git a/integration-tests/src/test/java/org/apache/druid/tests/indexer/ITNestedQueryPushDownTest.java b/integration-tests/src/test/java/org/apache/druid/tests/indexer/ITNestedQueryPushDownTest.java index 1825c6d2450..90ba30419c2 100644 --- a/integration-tests/src/test/java/org/apache/druid/tests/indexer/ITNestedQueryPushDownTest.java +++ b/integration-tests/src/test/java/org/apache/druid/tests/indexer/ITNestedQueryPushDownTest.java @@ -50,6 +50,7 @@ public class ITNestedQueryPushDownTest extends AbstractIndexerTest @Inject ClientInfoResourceTestClient clientInfoResourceTestClient; + @Test public void testIndexData() { diff --git a/pom.xml b/pom.xml index df30dd7880a..4c2938ebad2 100644 --- a/pom.xml +++ b/pom.xml @@ -878,9 +878,9 @@ org.apache.maven.plugins maven-checkstyle-plugin - 2.17 + 3.0.0 - ${project.build.sourceDirectory} + ${project.build.sourceDirectory} true codestyle/checkstyle.xml codestyle/checkstyle-suppressions.xml @@ -894,7 +894,7 @@ com.puppycrawl.tools checkstyle - 8.0 + 8.14 diff --git a/processing/src/main/java/org/apache/druid/collections/bitmap/RoaringBitmapFactory.java b/processing/src/main/java/org/apache/druid/collections/bitmap/RoaringBitmapFactory.java index 66f7bf096b6..8836d15bd87 100644 --- a/processing/src/main/java/org/apache/druid/collections/bitmap/RoaringBitmapFactory.java +++ b/processing/src/main/java/org/apache/druid/collections/bitmap/RoaringBitmapFactory.java @@ -55,6 +55,7 @@ public class RoaringBitmapFactory implements BitmapFactory throw Throwables.propagate(e); } } + private static final WrappedImmutableRoaringBitmap WRAPPED_IMMUTABLE_ROARING_BITMAP = new WrappedImmutableRoaringBitmap(EMPTY_IMMUTABLE_BITMAP); diff --git a/processing/src/main/java/org/apache/druid/query/LegacyDataSource.java b/processing/src/main/java/org/apache/druid/query/LegacyDataSource.java index 79c4014413a..d3812489be2 100644 --- a/processing/src/main/java/org/apache/druid/query/LegacyDataSource.java +++ b/processing/src/main/java/org/apache/druid/query/LegacyDataSource.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/processing/src/main/java/org/apache/druid/query/SubqueryQueryRunner.java b/processing/src/main/java/org/apache/druid/query/SubqueryQueryRunner.java index 50dca91101c..25eb1f6a982 100644 --- a/processing/src/main/java/org/apache/druid/query/SubqueryQueryRunner.java +++ b/processing/src/main/java/org/apache/druid/query/SubqueryQueryRunner.java @@ -19,8 +19,8 @@ package org.apache.druid.query; -import org.apache.druid.java.util.common.guava.Sequence; import com.google.common.collect.ImmutableMap; +import org.apache.druid.java.util.common.guava.Sequence; import org.apache.druid.query.groupby.GroupByQueryConfig; import java.util.Map; diff --git a/processing/src/main/java/org/apache/druid/query/TableDataSource.java b/processing/src/main/java/org/apache/druid/query/TableDataSource.java index bbebb51d593..f26aa53b93a 100644 --- a/processing/src/main/java/org/apache/druid/query/TableDataSource.java +++ b/processing/src/main/java/org/apache/druid/query/TableDataSource.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/processing/src/main/java/org/apache/druid/query/dimension/PrefixFilteredDimensionSpec.java b/processing/src/main/java/org/apache/druid/query/dimension/PrefixFilteredDimensionSpec.java index d4904b5c5c0..d3f2919b163 100644 --- a/processing/src/main/java/org/apache/druid/query/dimension/PrefixFilteredDimensionSpec.java +++ b/processing/src/main/java/org/apache/druid/query/dimension/PrefixFilteredDimensionSpec.java @@ -22,14 +22,15 @@ package org.apache.druid.query.dimension; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import com.google.common.base.Predicate; +import it.unimi.dsi.fastutil.ints.Int2IntMap; +import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; import org.apache.druid.common.config.NullHandling; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.query.filter.DimFilterUtils; import org.apache.druid.segment.DimensionSelector; -import it.unimi.dsi.fastutil.ints.Int2IntMap; -import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; -import java.nio.ByteBuffer; + import javax.annotation.Nullable; +import java.nio.ByteBuffer; /** */ diff --git a/processing/src/main/java/org/apache/druid/query/filter/SpatialDimFilter.java b/processing/src/main/java/org/apache/druid/query/filter/SpatialDimFilter.java index 1cd2c4624ac..0d12ac5979e 100644 --- a/processing/src/main/java/org/apache/druid/query/filter/SpatialDimFilter.java +++ b/processing/src/main/java/org/apache/druid/query/filter/SpatialDimFilter.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query.filter; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/DictionaryBuildingStringGroupByColumnSelectorStrategy.java b/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/DictionaryBuildingStringGroupByColumnSelectorStrategy.java index c44605e8a0a..6cb96346ac0 100644 --- a/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/DictionaryBuildingStringGroupByColumnSelectorStrategy.java +++ b/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/DictionaryBuildingStringGroupByColumnSelectorStrategy.java @@ -43,6 +43,7 @@ public class DictionaryBuildingStringGroupByColumnSelectorStrategy extends Strin private int nextId = 0; private final List dictionary = new ArrayList<>(); private final Object2IntOpenHashMap reverseDictionary = new Object2IntOpenHashMap<>(); + { reverseDictionary.defaultReturnValue(-1); } diff --git a/processing/src/main/java/org/apache/druid/query/monomorphicprocessing/SpecializationService.java b/processing/src/main/java/org/apache/druid/query/monomorphicprocessing/SpecializationService.java index daca57542de..43f1a1a5afd 100644 --- a/processing/src/main/java/org/apache/druid/query/monomorphicprocessing/SpecializationService.java +++ b/processing/src/main/java/org/apache/druid/query/monomorphicprocessing/SpecializationService.java @@ -67,6 +67,7 @@ public final class SpecializationService private static final Logger LOG = new Logger(SpecializationService.class); private static final Unsafe UNSAFE; + static { try { Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe"); diff --git a/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java b/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java index 3bce2011cf6..e780d36e10b 100644 --- a/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java +++ b/processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query.scan; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java b/processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java index 1502a502530..341a499c447 100644 --- a/processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java +++ b/processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query.scan; import com.google.common.base.Preconditions; diff --git a/processing/src/main/java/org/apache/druid/query/scan/ScanQueryLimitRowIterator.java b/processing/src/main/java/org/apache/druid/query/scan/ScanQueryLimitRowIterator.java index b655b21a155..3f56054b5f4 100644 --- a/processing/src/main/java/org/apache/druid/query/scan/ScanQueryLimitRowIterator.java +++ b/processing/src/main/java/org/apache/druid/query/scan/ScanQueryLimitRowIterator.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query.scan; import org.apache.druid.java.util.common.guava.Sequence; diff --git a/processing/src/main/java/org/apache/druid/query/scan/ScanQueryRunnerFactory.java b/processing/src/main/java/org/apache/druid/query/scan/ScanQueryRunnerFactory.java index c627469016a..73d9f680239 100644 --- a/processing/src/main/java/org/apache/druid/query/scan/ScanQueryRunnerFactory.java +++ b/processing/src/main/java/org/apache/druid/query/scan/ScanQueryRunnerFactory.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query.scan; import com.google.common.base.Function; diff --git a/processing/src/main/java/org/apache/druid/query/scan/ScanResultValue.java b/processing/src/main/java/org/apache/druid/query/scan/ScanResultValue.java index 6fa38250478..1c14d54cd2c 100644 --- a/processing/src/main/java/org/apache/druid/query/scan/ScanResultValue.java +++ b/processing/src/main/java/org/apache/druid/query/scan/ScanResultValue.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query.scan; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/processing/src/main/java/org/apache/druid/segment/AbstractSegment.java b/processing/src/main/java/org/apache/druid/segment/AbstractSegment.java index a7fb22cca39..6bf1f670440 100644 --- a/processing/src/main/java/org/apache/druid/segment/AbstractSegment.java +++ b/processing/src/main/java/org/apache/druid/segment/AbstractSegment.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment; public abstract class AbstractSegment implements Segment diff --git a/processing/src/main/java/org/apache/druid/segment/BitmapOffset.java b/processing/src/main/java/org/apache/druid/segment/BitmapOffset.java index 0729ea7324b..92f95121e2e 100644 --- a/processing/src/main/java/org/apache/druid/segment/BitmapOffset.java +++ b/processing/src/main/java/org/apache/druid/segment/BitmapOffset.java @@ -49,6 +49,7 @@ public class BitmapOffset extends Offset private static final String DEFAULT_FULLNESS_FACTORIZATION_STOPS = "0.01,0.1,0.3,0.5,0.7,0.9,0.99"; private static final double[] BITMAP_FULLNESS_FACTORIZATION_STOPS; private static final String[] FACTORIZED_FULLNESS; + static { String stopString = System.getProperty("bitmapFullnessFactorizationStops", DEFAULT_FULLNESS_FACTORIZATION_STOPS); String[] stopsArray = stopString.split(","); @@ -67,7 +68,6 @@ public class BitmapOffset extends Offset } Arrays.sort(BITMAP_FULLNESS_FACTORIZATION_STOPS); - double firstStop = BITMAP_FULLNESS_FACTORIZATION_STOPS[0]; if (Double.isNaN(firstStop) || firstStop <= 0.0) { throw new RE("First bitmapFullnessFactorizationStop[%d] should be > 0", firstStop); diff --git a/processing/src/main/java/org/apache/druid/segment/QueryableIndexIndexableAdapter.java b/processing/src/main/java/org/apache/druid/segment/QueryableIndexIndexableAdapter.java index 2353a9b8a05..e68a119113f 100644 --- a/processing/src/main/java/org/apache/druid/segment/QueryableIndexIndexableAdapter.java +++ b/processing/src/main/java/org/apache/druid/segment/QueryableIndexIndexableAdapter.java @@ -243,7 +243,6 @@ public class QueryableIndexIndexableAdapter implements IndexableAdapter offset::getOffset ); - markedDimensionValueSelectors = dimensionHandlers .stream() .map(DimensionHandler::makeNewSettableEncodedValueSelector) diff --git a/processing/src/main/java/org/apache/druid/segment/filter/SpatialFilter.java b/processing/src/main/java/org/apache/druid/segment/filter/SpatialFilter.java index 2ea703aa629..37b228d0842 100644 --- a/processing/src/main/java/org/apache/druid/segment/filter/SpatialFilter.java +++ b/processing/src/main/java/org/apache/druid/segment/filter/SpatialFilter.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment.filter; import com.google.common.base.Preconditions; diff --git a/processing/src/main/java/org/apache/druid/segment/serde/ComplexColumnPartSerde.java b/processing/src/main/java/org/apache/druid/segment/serde/ComplexColumnPartSerde.java index 0e5592619e8..c3623515681 100644 --- a/processing/src/main/java/org/apache/druid/segment/serde/ComplexColumnPartSerde.java +++ b/processing/src/main/java/org/apache/druid/segment/serde/ComplexColumnPartSerde.java @@ -34,6 +34,7 @@ public class ComplexColumnPartSerde implements ColumnPartSerde private final String typeName; private final ComplexMetricSerde serde; private final Serializer serializer; + private ComplexColumnPartSerde(String typeName, Serializer serializer) { this.typeName = typeName; diff --git a/processing/src/main/java/org/apache/druid/segment/serde/SpatialIndexColumnPartSupplier.java b/processing/src/main/java/org/apache/druid/segment/serde/SpatialIndexColumnPartSupplier.java index c5a3653e7e6..8f117543658 100644 --- a/processing/src/main/java/org/apache/druid/segment/serde/SpatialIndexColumnPartSupplier.java +++ b/processing/src/main/java/org/apache/druid/segment/serde/SpatialIndexColumnPartSupplier.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment.serde; import com.google.common.base.Supplier; diff --git a/processing/src/test/java/org/apache/druid/query/DoubleStorageTest.java b/processing/src/test/java/org/apache/druid/query/DoubleStorageTest.java index bc712b70a6f..2ed7b7131f8 100644 --- a/processing/src/test/java/org/apache/druid/query/DoubleStorageTest.java +++ b/processing/src/test/java/org/apache/druid/query/DoubleStorageTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query; import com.google.common.base.Throwables; diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/JavaScriptAggregatorBenchmark.java b/processing/src/test/java/org/apache/druid/query/aggregation/JavaScriptAggregatorBenchmark.java index 79d63c3d4e9..e3024782f7b 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/JavaScriptAggregatorBenchmark.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/JavaScriptAggregatorBenchmark.java @@ -26,7 +26,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; - /** * TODO rewrite to use JMH and move to benchmarks project */ @@ -34,6 +33,7 @@ public class JavaScriptAggregatorBenchmark extends SimpleBenchmark { protected static final Map scriptDoubleSum = new HashMap<>(); + static { scriptDoubleSum.put("fnAggregate", "function aggregate(current, a) { return current + a }"); scriptDoubleSum.put("fnReset", "function reset() { return 0 }"); diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorTest.java index ec56024ef51..c17e645aa8b 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorTest.java @@ -340,22 +340,18 @@ public class CardinalityAggregatorTest false ); - String superJsFn = "function(str) { return 'super-' + str; }"; ExtractionFn superFn = new JavaScriptExtractionFn(superJsFn, false, JavaScriptConfig.getEnabledInstance()); dim1WithExtraction = new TestDimensionSelector(values1, superFn); dim2WithExtraction = new TestDimensionSelector(values2, superFn); - selectorListWithExtraction = Lists.newArrayList( - (DimensionSelector) dim1WithExtraction, - dim2WithExtraction - ); + selectorListWithExtraction = Lists.newArrayList(dim1WithExtraction, dim2WithExtraction); dimInfoListWithExtraction = Lists.newArrayList( - new ColumnSelectorPlus( + new ColumnSelectorPlus<>( dimSpec1.getDimension(), dimSpec1.getOutputName(), new StringCardinalityAggregatorColumnSelectorStrategy(), dim1WithExtraction ), - new ColumnSelectorPlus( + new ColumnSelectorPlus<>( dimSpec1.getDimension(), dimSpec1.getOutputName(), new StringCardinalityAggregatorColumnSelectorStrategy(), dim2WithExtraction @@ -366,17 +362,14 @@ public class CardinalityAggregatorTest ExtractionFn helloFn = new JavaScriptExtractionFn(helloJsFn, false, JavaScriptConfig.getEnabledInstance()); dim1ConstantVal = new TestDimensionSelector(values1, helloFn); dim2ConstantVal = new TestDimensionSelector(values2, helloFn); - selectorListConstantVal = Lists.newArrayList( - (DimensionSelector) dim1ConstantVal, - dim2ConstantVal - ); + selectorListConstantVal = Lists.newArrayList(dim1ConstantVal, dim2ConstantVal); dimInfoListConstantVal = Lists.newArrayList( - new ColumnSelectorPlus( + new ColumnSelectorPlus<>( dimSpec1.getDimension(), dimSpec1.getOutputName(), new StringCardinalityAggregatorColumnSelectorStrategy(), dim1ConstantVal ), - new ColumnSelectorPlus( + new ColumnSelectorPlus<>( dimSpec1.getDimension(), dimSpec1.getOutputName(), new StringCardinalityAggregatorColumnSelectorStrategy(), dim2ConstantVal diff --git a/processing/src/test/java/org/apache/druid/query/dimension/PrefixFilteredDimensionSpecTest.java b/processing/src/test/java/org/apache/druid/query/dimension/PrefixFilteredDimensionSpecTest.java index 2dc8fecb025..9538a538156 100644 --- a/processing/src/test/java/org/apache/druid/query/dimension/PrefixFilteredDimensionSpecTest.java +++ b/processing/src/test/java/org/apache/druid/query/dimension/PrefixFilteredDimensionSpecTest.java @@ -23,10 +23,11 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.druid.segment.DimensionSelector; import org.apache.druid.segment.TestHelper; import org.apache.druid.segment.data.IndexedInts; -import java.util.Arrays; import org.junit.Assert; import org.junit.Test; +import java.util.Arrays; + /** */ public class PrefixFilteredDimensionSpecTest diff --git a/processing/src/test/java/org/apache/druid/query/extraction/LowerExtractionFnTest.java b/processing/src/test/java/org/apache/druid/query/extraction/LowerExtractionFnTest.java index 76609ac3f8f..d33c1ee6622 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/LowerExtractionFnTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/LowerExtractionFnTest.java @@ -28,6 +28,7 @@ import java.util.Arrays; public class LowerExtractionFnTest { ExtractionFn extractionFn = new LowerExtractionFn(null); + @Test public void testApply() { diff --git a/processing/src/test/java/org/apache/druid/query/extraction/UpperExtractionFnTest.java b/processing/src/test/java/org/apache/druid/query/extraction/UpperExtractionFnTest.java index 05a2590091f..e9d6e2339b5 100644 --- a/processing/src/test/java/org/apache/druid/query/extraction/UpperExtractionFnTest.java +++ b/processing/src/test/java/org/apache/druid/query/extraction/UpperExtractionFnTest.java @@ -28,6 +28,7 @@ import java.util.Arrays; public class UpperExtractionFnTest { ExtractionFn extractionFn = new UpperExtractionFn(null); + @Test public void testApply() { diff --git a/processing/src/test/java/org/apache/druid/query/filter/AndDimFilterTest.java b/processing/src/test/java/org/apache/druid/query/filter/AndDimFilterTest.java index 4e430c70c13..f2d6c434884 100644 --- a/processing/src/test/java/org/apache/druid/query/filter/AndDimFilterTest.java +++ b/processing/src/test/java/org/apache/druid/query/filter/AndDimFilterTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query.filter; import com.google.common.collect.Lists; diff --git a/processing/src/test/java/org/apache/druid/query/filter/InDimFilterSerDesrTest.java b/processing/src/test/java/org/apache/druid/query/filter/InDimFilterSerDesrTest.java index d16fb3240d9..9e550903799 100644 --- a/processing/src/test/java/org/apache/druid/query/filter/InDimFilterSerDesrTest.java +++ b/processing/src/test/java/org/apache/druid/query/filter/InDimFilterSerDesrTest.java @@ -37,7 +37,9 @@ public class InDimFilterSerDesrTest { private static ObjectMapper mapper; - private final String actualInFilter = "{\"type\":\"in\",\"dimension\":\"dimTest\",\"values\":[\"bad\",\"good\"],\"extractionFn\":null}"; + private final String actualInFilter = + "{\"type\":\"in\",\"dimension\":\"dimTest\",\"values\":[\"bad\",\"good\"],\"extractionFn\":null}"; + @Before public void setUp() { diff --git a/processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryMergeBufferTest.java b/processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryMergeBufferTest.java index b013195f6b3..e65aaa29568 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryMergeBufferTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/GroupByQueryMergeBufferTest.java @@ -60,6 +60,7 @@ import static org.junit.Assert.assertEquals; public class GroupByQueryMergeBufferTest { private static final long TIMEOUT = 5000; + private static class TestBlockingPool extends CloseableDefaultBlockingPool { private int minRemainBufferNum; diff --git a/processing/src/test/java/org/apache/druid/query/groupby/NestedQueryPushDownTest.java b/processing/src/test/java/org/apache/druid/query/groupby/NestedQueryPushDownTest.java index 1bf936dbec6..ce9a36e3e2b 100644 --- a/processing/src/test/java/org/apache/druid/query/groupby/NestedQueryPushDownTest.java +++ b/processing/src/test/java/org/apache/druid/query/groupby/NestedQueryPushDownTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.query.groupby; import com.fasterxml.jackson.databind.InjectableValues; diff --git a/processing/src/test/java/org/apache/druid/query/select/SelectQueryRunnerTest.java b/processing/src/test/java/org/apache/druid/query/select/SelectQueryRunnerTest.java index 058d0bcb50e..f740679b22b 100644 --- a/processing/src/test/java/org/apache/druid/query/select/SelectQueryRunnerTest.java +++ b/processing/src/test/java/org/apache/druid/query/select/SelectQueryRunnerTest.java @@ -113,9 +113,11 @@ public class SelectQueryRunnerTest private static final boolean DEFAULT_FROM_NEXT = true; private static final SelectQueryConfig config = new SelectQueryConfig(true); - { + + static { config.setEnableFromNextDefault(DEFAULT_FROM_NEXT); } + private static final Supplier configSupplier = Suppliers.ofInstance(config); private static final SelectQueryQueryToolChest toolChest = new SelectQueryQueryToolChest( diff --git a/processing/src/test/java/org/apache/druid/query/select/SelectQuerySpecTest.java b/processing/src/test/java/org/apache/druid/query/select/SelectQuerySpecTest.java index 49887c2cd93..2915f6947a5 100644 --- a/processing/src/test/java/org/apache/druid/query/select/SelectQuerySpecTest.java +++ b/processing/src/test/java/org/apache/druid/query/select/SelectQuerySpecTest.java @@ -38,12 +38,10 @@ import java.util.Collections; public class SelectQuerySpecTest { private final ObjectMapper objectMapper = new DefaultObjectMapper(); + { objectMapper.setInjectableValues( - new InjectableValues.Std().addValue( - SelectQueryConfig.class, - new SelectQueryConfig(true) - ) + new InjectableValues.Std().addValue(SelectQueryConfig.class, new SelectQueryConfig(true)) ); } diff --git a/processing/src/test/java/org/apache/druid/segment/IndexMergerV9CompatibilityTest.java b/processing/src/test/java/org/apache/druid/segment/IndexMergerV9CompatibilityTest.java index c25fd76ef7d..68835084c03 100644 --- a/processing/src/test/java/org/apache/druid/segment/IndexMergerV9CompatibilityTest.java +++ b/processing/src/test/java/org/apache/druid/segment/IndexMergerV9CompatibilityTest.java @@ -108,7 +108,6 @@ public class IndexMergerV9CompatibilityTest DIMS.get(1), "dim10" ); - final Map map3 = ImmutableMap.of( DIMS.get(0), ImmutableList.of("dim00", "dim01") diff --git a/processing/src/test/java/org/apache/druid/segment/data/BitmapCreationBenchmark.java b/processing/src/test/java/org/apache/druid/segment/data/BitmapCreationBenchmark.java index 77757604325..f01dc5d388e 100644 --- a/processing/src/test/java/org/apache/druid/segment/data/BitmapCreationBenchmark.java +++ b/processing/src/test/java/org/apache/druid/segment/data/BitmapCreationBenchmark.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment.data; import com.carrotsearch.junitbenchmarks.AbstractBenchmark; diff --git a/processing/src/test/java/org/apache/druid/segment/filter/FilterPartitionTest.java b/processing/src/test/java/org/apache/druid/segment/filter/FilterPartitionTest.java index acd7498eb5d..1d48b377338 100644 --- a/processing/src/test/java/org/apache/druid/segment/filter/FilterPartitionTest.java +++ b/processing/src/test/java/org/apache/druid/segment/filter/FilterPartitionTest.java @@ -99,14 +99,11 @@ public class FilterPartitionTest extends BaseFilterTest private static class NoBitmapSelectorDimFilter extends SelectorDimFilter { - public NoBitmapSelectorDimFilter( - String dimension, - String value, - ExtractionFn extractionFn - ) + NoBitmapSelectorDimFilter(String dimension, String value, ExtractionFn extractionFn) { super(dimension, value, extractionFn); } + @Override public Filter toFilter() { diff --git a/processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexRowSizeTest.java b/processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexRowSizeTest.java index 0952c436c4f..0e5283bc7bd 100644 --- a/processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexRowSizeTest.java +++ b/processing/src/test/java/org/apache/druid/segment/incremental/IncrementalIndexRowSizeTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment.incremental; import com.google.common.collect.Lists; diff --git a/server/src/main/java/org/apache/druid/metadata/SQLFirehoseDatabaseConnector.java b/server/src/main/java/org/apache/druid/metadata/SQLFirehoseDatabaseConnector.java index 59860265cbe..242f04bccfc 100644 --- a/server/src/main/java/org/apache/druid/metadata/SQLFirehoseDatabaseConnector.java +++ b/server/src/main/java/org/apache/druid/metadata/SQLFirehoseDatabaseConnector.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.metadata; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/server/src/main/java/org/apache/druid/query/lookup/MapLookupExtractorFactory.java b/server/src/main/java/org/apache/druid/query/lookup/MapLookupExtractorFactory.java index d89e197049a..3f39e149ba3 100644 --- a/server/src/main/java/org/apache/druid/query/lookup/MapLookupExtractorFactory.java +++ b/server/src/main/java/org/apache/druid/query/lookup/MapLookupExtractorFactory.java @@ -123,6 +123,7 @@ public class MapLookupExtractorFactory implements LookupExtractorFactory public static class MapLookupIntrospectionHandler implements LookupIntrospectHandler { private final Map map; + public MapLookupIntrospectionHandler(Map map) { this.map = map; diff --git a/server/src/main/java/org/apache/druid/segment/indexing/TuningConfigs.java b/server/src/main/java/org/apache/druid/segment/indexing/TuningConfigs.java index cc0f005d0ae..9c470ab677d 100644 --- a/server/src/main/java/org/apache/druid/segment/indexing/TuningConfigs.java +++ b/server/src/main/java/org/apache/druid/segment/indexing/TuningConfigs.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment.indexing; public class TuningConfigs diff --git a/server/src/main/java/org/apache/druid/segment/loading/LocalFileTimestampVersionFinder.java b/server/src/main/java/org/apache/druid/segment/loading/LocalFileTimestampVersionFinder.java index 4ca982db0fb..9cb47e9338c 100644 --- a/server/src/main/java/org/apache/druid/segment/loading/LocalFileTimestampVersionFinder.java +++ b/server/src/main/java/org/apache/druid/segment/loading/LocalFileTimestampVersionFinder.java @@ -31,14 +31,11 @@ import java.net.URI; import java.nio.file.Path; import java.util.regex.Pattern; -/** - * This is implemented explicitly for URIExtractionNamespaceFunctionFactory - * If you have a use case for this interface beyond URIExtractionNamespaceFunctionFactory please bring it up in the dev list. - */ public class LocalFileTimestampVersionFinder extends LocalDataSegmentPuller implements SearchableVersionedDataFinder { public static final String URI_SCHEME = "file"; + private URI mostRecentInDir(final Path dir, final Pattern pattern) { long latestModified = Long.MIN_VALUE; @@ -68,7 +65,8 @@ public class LocalFileTimestampVersionFinder extends LocalDataSegmentPuller * Matches based on a pattern in the file name. Returns the file with the latest timestamp. * * @param uri If it is a file, then the parent is searched. If it is a directory, then the directory is searched. - * @param pattern The matching filter to down-select the file names in the directory of interest. Passing `null` results in matching any file + * @param pattern The matching filter to down-select the file names in the directory of interest. Passing `null` + * results in matching any file * * @return The URI of the most recently modified file which matches the pattern, or `null` if it cannot be found */ diff --git a/server/src/main/java/org/apache/druid/segment/realtime/firehose/SqlFirehoseFactory.java b/server/src/main/java/org/apache/druid/segment/realtime/firehose/SqlFirehoseFactory.java index fc380aa9924..43738f8f684 100644 --- a/server/src/main/java/org/apache/druid/segment/realtime/firehose/SqlFirehoseFactory.java +++ b/server/src/main/java/org/apache/druid/segment/realtime/firehose/SqlFirehoseFactory.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment.realtime.firehose; import com.fasterxml.jackson.annotation.JacksonInject; diff --git a/server/src/main/java/org/apache/druid/server/audit/SQLAuditManagerProvider.java b/server/src/main/java/org/apache/druid/server/audit/SQLAuditManagerProvider.java index a9309f01c4c..fdb9900ab29 100644 --- a/server/src/main/java/org/apache/druid/server/audit/SQLAuditManagerProvider.java +++ b/server/src/main/java/org/apache/druid/server/audit/SQLAuditManagerProvider.java @@ -38,6 +38,7 @@ public class SQLAuditManagerProvider implements AuditManagerProvider private final ServiceEmitter emitter; private final ObjectMapper mapper; private final SQLAuditManagerConfig config; + @Inject public SQLAuditManagerProvider( Supplier dbTables, diff --git a/server/src/main/java/org/apache/druid/server/coordination/ChangeRequestsSnapshot.java b/server/src/main/java/org/apache/druid/server/coordination/ChangeRequestsSnapshot.java index 96b2a24f855..2710ff3dcd5 100644 --- a/server/src/main/java/org/apache/druid/server/coordination/ChangeRequestsSnapshot.java +++ b/server/src/main/java/org/apache/druid/server/coordination/ChangeRequestsSnapshot.java @@ -55,7 +55,6 @@ public class ChangeRequestsSnapshot Preconditions.checkNotNull(resetCause, "NULL resetCause when resetCounter is true."); } - this.counter = counter; this.requests = requests; } diff --git a/server/src/main/java/org/apache/druid/server/coordinator/BalancerStrategyFactory.java b/server/src/main/java/org/apache/druid/server/coordinator/BalancerStrategyFactory.java index b168ab1161e..7e79c9a4455 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/BalancerStrategyFactory.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/BalancerStrategyFactory.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.server.coordinator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/server/src/main/java/org/apache/druid/server/coordinator/BytesAccumulatingResponseHandler.java b/server/src/main/java/org/apache/druid/server/coordinator/BytesAccumulatingResponseHandler.java index c9e89c3c35d..88d82264d0c 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/BytesAccumulatingResponseHandler.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/BytesAccumulatingResponseHandler.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.server.coordinator; import org.apache.druid.java.util.http.client.io.AppendableByteArrayInputStream; diff --git a/server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java b/server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java index 8e8df480bdf..726f2fa07db 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.server.coordinator; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/server/src/main/java/org/apache/druid/server/coordinator/CostBalancerStrategyFactory.java b/server/src/main/java/org/apache/druid/server/coordinator/CostBalancerStrategyFactory.java index 08cdd05b6eb..c846acf3e8a 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/CostBalancerStrategyFactory.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/CostBalancerStrategyFactory.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.server.coordinator; import com.google.common.util.concurrent.ListeningExecutorService; diff --git a/server/src/main/java/org/apache/druid/server/coordinator/DiskNormalizedCostBalancerStrategyFactory.java b/server/src/main/java/org/apache/druid/server/coordinator/DiskNormalizedCostBalancerStrategyFactory.java index 90fc6f9673b..10a32bce274 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/DiskNormalizedCostBalancerStrategyFactory.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/DiskNormalizedCostBalancerStrategyFactory.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.server.coordinator; import com.google.common.util.concurrent.ListeningExecutorService; diff --git a/server/src/main/java/org/apache/druid/server/coordinator/RandomBalancerStrategyFactory.java b/server/src/main/java/org/apache/druid/server/coordinator/RandomBalancerStrategyFactory.java index e5770c5073d..c02554050eb 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/RandomBalancerStrategyFactory.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/RandomBalancerStrategyFactory.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.server.coordinator; import com.google.common.util.concurrent.ListeningExecutorService; diff --git a/server/src/main/java/org/apache/druid/server/http/OverlordProxyServlet.java b/server/src/main/java/org/apache/druid/server/http/OverlordProxyServlet.java index 8ed6ac087ca..0fa0f3e2c64 100644 --- a/server/src/main/java/org/apache/druid/server/http/OverlordProxyServlet.java +++ b/server/src/main/java/org/apache/druid/server/http/OverlordProxyServlet.java @@ -20,6 +20,7 @@ package org.apache.druid.server.http; import com.google.inject.Inject; +import com.google.inject.Provider; import org.apache.druid.client.indexing.IndexingService; import org.apache.druid.discovery.DruidLeaderClient; import org.apache.druid.guice.annotations.Global; @@ -27,7 +28,6 @@ import org.apache.druid.guice.http.DruidHttpClientConfig; import org.apache.druid.java.util.common.ISE; import org.apache.druid.server.JettyUtils; import org.apache.druid.server.security.AuthConfig; -import com.google.inject.Provider; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.proxy.ProxyServlet; diff --git a/server/src/main/java/org/apache/druid/server/initialization/TLSServerConfig.java b/server/src/main/java/org/apache/druid/server/initialization/TLSServerConfig.java index 4e8a625023b..f6b8c4a1942 100644 --- a/server/src/main/java/org/apache/druid/server/initialization/TLSServerConfig.java +++ b/server/src/main/java/org/apache/druid/server/initialization/TLSServerConfig.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.server.initialization; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/server/src/main/java/org/apache/druid/server/metrics/QueryCountStatsMonitor.java b/server/src/main/java/org/apache/druid/server/metrics/QueryCountStatsMonitor.java index e217e8de804..c3b956c23d9 100644 --- a/server/src/main/java/org/apache/druid/server/metrics/QueryCountStatsMonitor.java +++ b/server/src/main/java/org/apache/druid/server/metrics/QueryCountStatsMonitor.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.server.metrics; import com.google.common.collect.ImmutableMap; diff --git a/server/src/main/java/org/apache/druid/server/metrics/QueryCountStatsProvider.java b/server/src/main/java/org/apache/druid/server/metrics/QueryCountStatsProvider.java index a7bd8762b24..9c920857f80 100644 --- a/server/src/main/java/org/apache/druid/server/metrics/QueryCountStatsProvider.java +++ b/server/src/main/java/org/apache/druid/server/metrics/QueryCountStatsProvider.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.server.metrics; public interface QueryCountStatsProvider diff --git a/server/src/main/java/org/apache/druid/server/router/ConsistentHasher.java b/server/src/main/java/org/apache/druid/server/router/ConsistentHasher.java index 8af81f05c54..ed0b9676eed 100644 --- a/server/src/main/java/org/apache/druid/server/router/ConsistentHasher.java +++ b/server/src/main/java/org/apache/druid/server/router/ConsistentHasher.java @@ -43,16 +43,16 @@ public class ConsistentHasher private static final HashFunction DEFAULT_HASH_FN = Hashing.murmur3_128(); private final Long2ObjectRBTreeMap nodeKeySlots = new Long2ObjectRBTreeMap<>(); + { nodeKeySlots.defaultReturnValue(null); } + private final HashFunction hashFn; private final Map nodeKeyHashes = new HashMap<>(); private Set previousKeys = new HashSet<>(); - public ConsistentHasher( - final HashFunction hashFunction - ) + public ConsistentHasher(final HashFunction hashFunction) { this.hashFn = hashFunction == null ? DEFAULT_HASH_FN : hashFunction; } diff --git a/server/src/main/java/org/apache/druid/server/security/DefaultTLSCertificateCheckerModule.java b/server/src/main/java/org/apache/druid/server/security/DefaultTLSCertificateCheckerModule.java index 8b2384b2eef..3c2745ac352 100644 --- a/server/src/main/java/org/apache/druid/server/security/DefaultTLSCertificateCheckerModule.java +++ b/server/src/main/java/org/apache/druid/server/security/DefaultTLSCertificateCheckerModule.java @@ -21,7 +21,6 @@ package org.apache.druid.server.security; import com.google.inject.Binder; import com.google.inject.Module; - import com.google.inject.name.Names; public class DefaultTLSCertificateCheckerModule implements Module diff --git a/server/src/main/java/org/apache/druid/server/security/TLSUtils.java b/server/src/main/java/org/apache/druid/server/security/TLSUtils.java index 69fcdd234bb..83d1e507f16 100644 --- a/server/src/main/java/org/apache/druid/server/security/TLSUtils.java +++ b/server/src/main/java/org/apache/druid/server/security/TLSUtils.java @@ -23,7 +23,6 @@ import com.google.common.base.Preconditions; import com.google.common.base.Throwables; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.metadata.PasswordProvider; - import org.eclipse.jetty.util.ssl.AliasedX509ExtendedKeyManager; import javax.annotation.Nullable; diff --git a/server/src/test/java/org/apache/druid/client/CachingClusteredClientFunctionalityTest.java b/server/src/test/java/org/apache/druid/client/CachingClusteredClientFunctionalityTest.java index 47407215af0..d05cfc809ac 100644 --- a/server/src/test/java/org/apache/druid/client/CachingClusteredClientFunctionalityTest.java +++ b/server/src/test/java/org/apache/druid/client/CachingClusteredClientFunctionalityTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.client; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/server/src/test/java/org/apache/druid/client/CachingClusteredClientTestUtils.java b/server/src/test/java/org/apache/druid/client/CachingClusteredClientTestUtils.java index 3609e2af777..5a283f89397 100644 --- a/server/src/test/java/org/apache/druid/client/CachingClusteredClientTestUtils.java +++ b/server/src/test/java/org/apache/druid/client/CachingClusteredClientTestUtils.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.client; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/server/src/test/java/org/apache/druid/metadata/SQLMetadataConnectorTest.java b/server/src/test/java/org/apache/druid/metadata/SQLMetadataConnectorTest.java index f42199c25b8..a86c07e1c5f 100644 --- a/server/src/test/java/org/apache/druid/metadata/SQLMetadataConnectorTest.java +++ b/server/src/test/java/org/apache/druid/metadata/SQLMetadataConnectorTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.metadata; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/server/src/test/java/org/apache/druid/segment/realtime/appenderator/AppenderatorPlumberTest.java b/server/src/test/java/org/apache/druid/segment/realtime/appenderator/AppenderatorPlumberTest.java index b5f37a6cca3..09e621ba5ee 100644 --- a/server/src/test/java/org/apache/druid/segment/realtime/appenderator/AppenderatorPlumberTest.java +++ b/server/src/test/java/org/apache/druid/segment/realtime/appenderator/AppenderatorPlumberTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment.realtime.appenderator; import org.apache.druid.data.input.InputRow; diff --git a/server/src/test/java/org/apache/druid/segment/realtime/appenderator/SegmentWithStateTest.java b/server/src/test/java/org/apache/druid/segment/realtime/appenderator/SegmentWithStateTest.java index 8f037ac2403..c19ec56b6d7 100644 --- a/server/src/test/java/org/apache/druid/segment/realtime/appenderator/SegmentWithStateTest.java +++ b/server/src/test/java/org/apache/druid/segment/realtime/appenderator/SegmentWithStateTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.segment.realtime.appenderator; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/server/src/test/java/org/apache/druid/segment/realtime/firehose/IngestSegmentFirehoseTest.java b/server/src/test/java/org/apache/druid/segment/realtime/firehose/IngestSegmentFirehoseTest.java index d6c51a91c52..1bb58ab4090 100644 --- a/server/src/test/java/org/apache/druid/segment/realtime/firehose/IngestSegmentFirehoseTest.java +++ b/server/src/test/java/org/apache/druid/segment/realtime/firehose/IngestSegmentFirehoseTest.java @@ -133,8 +133,8 @@ public class IngestSegmentFirehoseTest .withMetrics(AGGREGATORS_REINDEX.toArray(new AggregatorFactory[0])) .build() ) - .setMaxRowCount(5000) - .buildOnheap() + .setMaxRowCount(5000) + .buildOnheap() ) { final StorageAdapter sa = new QueryableIndexStorageAdapter(qi); final WindowedStorageAdapter wsa = new WindowedStorageAdapter(sa, sa.getInterval()); @@ -223,8 +223,8 @@ public class IngestSegmentFirehoseTest .withMetrics(AGGREGATORS.toArray(new AggregatorFactory[0])) .build() ) - .setMaxRowCount(5000) - .buildOnheap() + .setMaxRowCount(5000) + .buildOnheap() ) { for (String line : rows) { index.add(parser.parse(line)); diff --git a/server/src/test/java/org/apache/druid/server/QueryResourceTest.java b/server/src/test/java/org/apache/druid/server/QueryResourceTest.java index dcfeb0bf341..e6a341fc544 100644 --- a/server/src/test/java/org/apache/druid/server/QueryResourceTest.java +++ b/server/src/test/java/org/apache/druid/server/QueryResourceTest.java @@ -19,9 +19,9 @@ package org.apache.druid.server; -import com.fasterxml.jackson.jaxrs.smile.SmileMediaTypes; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.jaxrs.smile.SmileMediaTypes; import com.google.common.base.Throwables; import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.ListenableFuture; diff --git a/server/src/test/java/org/apache/druid/server/metrics/ExceptionCapturingServiceEmitter.java b/server/src/test/java/org/apache/druid/server/metrics/ExceptionCapturingServiceEmitter.java index f70595a2fa0..c28744220f1 100644 --- a/server/src/test/java/org/apache/druid/server/metrics/ExceptionCapturingServiceEmitter.java +++ b/server/src/test/java/org/apache/druid/server/metrics/ExceptionCapturingServiceEmitter.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.server.metrics; import org.apache.druid.java.util.emitter.EmittingLogger; diff --git a/services/src/test/java/org/apache/druid/cli/MainTest.java b/services/src/test/java/org/apache/druid/cli/MainTest.java index 9d8a891a418..1a35b666487 100644 --- a/services/src/test/java/org/apache/druid/cli/MainTest.java +++ b/services/src/test/java/org/apache/druid/cli/MainTest.java @@ -55,11 +55,14 @@ public class MainTest new Object[]{new CliRouter()} ); } + private final GuiceRunnable runnable; + public MainTest(GuiceRunnable runnable) { this.runnable = runnable; } + @Test public void testSimpleInjection() { diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rel/SortProject.java b/sql/src/main/java/org/apache/druid/sql/calcite/rel/SortProject.java index f55fa18fb03..f7c503b83f2 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rel/SortProject.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rel/SortProject.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.sql.calcite.rel; import com.google.common.base.Preconditions; diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/schema/SegmentMetadataHolder.java b/sql/src/main/java/org/apache/druid/sql/calcite/schema/SegmentMetadataHolder.java index cb446e91109..b2666e149b5 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/schema/SegmentMetadataHolder.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/schema/SegmentMetadataHolder.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.sql.calcite.schema; import org.apache.druid.sql.calcite.table.RowSignature; diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java b/sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java index a004e80b810..431f4b1730e 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.sql.calcite.schema; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/schema/SystemSchemaTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/schema/SystemSchemaTest.java index 851adff9454..9dc5a0e55f3 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/schema/SystemSchemaTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/schema/SystemSchemaTest.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.druid.sql.calcite.schema; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/util/TestServerInventoryView.java b/sql/src/test/java/org/apache/druid/sql/calcite/util/TestServerInventoryView.java index e0b6825cc73..363d595f38d 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/util/TestServerInventoryView.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/util/TestServerInventoryView.java @@ -34,7 +34,10 @@ import org.apache.druid.timeline.TimelineLookup; import javax.annotation.Nullable; import java.util.List; import java.util.concurrent.Executor; -// this class is used for testing and benchmark + +/** + * This class is used for testing and benchmark + */ public class TestServerInventoryView implements TimelineServerView { private static final DruidServerMetadata DUMMY_SERVER = new DruidServerMetadata(