diff --git a/.idea/inspectionProfiles/Druid.xml b/.idea/inspectionProfiles/Druid.xml index 5d889a5af5dd..d4aeeb2afd8e 100644 --- a/.idea/inspectionProfiles/Druid.xml +++ b/.idea/inspectionProfiles/Druid.xml @@ -104,6 +104,12 @@ + + + + diff --git a/.idea/scopes/NonGeneratedFiles.xml b/.idea/scopes/NonGeneratedFiles.xml new file mode 100644 index 000000000000..22375373e966 --- /dev/null +++ b/.idea/scopes/NonGeneratedFiles.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/api/src/main/java/io/druid/guice/JsonConfigProvider.java b/api/src/main/java/io/druid/guice/JsonConfigProvider.java index f9017af2ff9f..f91e7ca0fc12 100644 --- a/api/src/main/java/io/druid/guice/JsonConfigProvider.java +++ b/api/src/main/java/io/druid/guice/JsonConfigProvider.java @@ -48,7 +48,7 @@ *

Implementation

*
* The state of {@code } is defined by the value of the property {@code propertyBase}. - * This value is a json structure, decoded via {@link JsonConfigurator#configurate(java.util.Properties, String, Class)}. + * This value is a json structure, decoded via {@link JsonConfigurator#configurate(Properties, String, Class)}. *
* * An example might be if DruidServerConfig.class were diff --git a/api/src/main/java/io/druid/guice/LifecycleModule.java b/api/src/main/java/io/druid/guice/LifecycleModule.java index eb65d7c2e284..36af8ede8096 100644 --- a/api/src/main/java/io/druid/guice/LifecycleModule.java +++ b/api/src/main/java/io/druid/guice/LifecycleModule.java @@ -49,8 +49,8 @@ public class LifecycleModule implements Module * scope. That is, they are generally eagerly loaded because the loading operation will produce some beneficial * side-effect even if nothing actually directly depends on the instance. * - * This mechanism exists to allow the {@link io.druid.java.util.common.lifecycle.Lifecycle} to be the primary entry point from the injector, not to - * auto-register things with the {@link io.druid.java.util.common.lifecycle.Lifecycle}. It is also possible to just bind things eagerly with Guice, + * This mechanism exists to allow the {@link Lifecycle} to be the primary entry point from the injector, not to + * auto-register things with the {@link Lifecycle}. It is also possible to just bind things eagerly with Guice, * it is not clear which is actually the best approach. This is more explicit, but eager bindings inside of modules * is less error-prone. * @@ -70,8 +70,8 @@ public static void register(Binder binder, Class clazz) * scope. That is, they are generally eagerly loaded because the loading operation will produce some beneficial * side-effect even if nothing actually directly depends on the instance. * - * This mechanism exists to allow the {@link io.druid.java.util.common.lifecycle.Lifecycle} to be the primary entry point from the injector, not to - * auto-register things with the {@link io.druid.java.util.common.lifecycle.Lifecycle}. It is also possible to just bind things eagerly with Guice, + * This mechanism exists to allow the {@link Lifecycle} to be the primary entry point from the injector, not to + * auto-register things with the {@link Lifecycle}. It is also possible to just bind things eagerly with Guice, * it is not clear which is actually the best approach. This is more explicit, but eager bindings inside of modules * is less error-prone. * @@ -92,8 +92,8 @@ public static void register(Binder binder, Class clazz, Annotation annotation * scope. That is, they are generally eagerly loaded because the loading operation will produce some beneficial * side-effect even if nothing actually directly depends on the instance. * - * This mechanism exists to allow the {@link io.druid.java.util.common.lifecycle.Lifecycle} to be the primary entry point from the injector, not to - * auto-register things with the {@link io.druid.java.util.common.lifecycle.Lifecycle}. It is also possible to just bind things eagerly with Guice, + * This mechanism exists to allow the {@link Lifecycle} to be the primary entry point from the injector, not to + * auto-register things with the {@link Lifecycle}. It is also possible to just bind things eagerly with Guice, * it is not clear which is actually the best approach. This is more explicit, but eager bindings inside of modules * is less error-prone. * @@ -107,15 +107,15 @@ public static void register(Binder binder, Class clazz, Class ScopedBindingBuilder createChoice( } /** - * @deprecated use {@link #createChoiceWithDefault(com.google.inject.Binder, String, com.google.inject.Key, String)} + * @deprecated use {@link #createChoiceWithDefault(Binder, String, Key, String)} * instead. {@code defaultKey} argument is ignored. */ @Deprecated diff --git a/api/src/main/java/io/druid/timeline/DataSegmentUtils.java b/api/src/main/java/io/druid/timeline/DataSegmentUtils.java index 357892a776d8..242c432bc182 100644 --- a/api/src/main/java/io/druid/timeline/DataSegmentUtils.java +++ b/api/src/main/java/io/druid/timeline/DataSegmentUtils.java @@ -67,8 +67,7 @@ public Interval apply(String identifier) * * @param dataSource the dataSource corresponding to this identifier * @param identifier segment identifier - * @return a {@link io.druid.timeline.DataSegmentUtils.SegmentIdentifierParts} object if the identifier could be - * parsed, null otherwise + * @return a {@link DataSegmentUtils.SegmentIdentifierParts} object if the identifier could be parsed, null otherwise */ public static SegmentIdentifierParts valueOf(String dataSource, String identifier) { diff --git a/aws-common/src/main/java/io/druid/common/aws/ConfigDrivenAwsCredentialsConfigProvider.java b/aws-common/src/main/java/io/druid/common/aws/ConfigDrivenAwsCredentialsConfigProvider.java index f0553c5003cd..8ec52378078e 100644 --- a/aws-common/src/main/java/io/druid/common/aws/ConfigDrivenAwsCredentialsConfigProvider.java +++ b/aws-common/src/main/java/io/druid/common/aws/ConfigDrivenAwsCredentialsConfigProvider.java @@ -20,6 +20,7 @@ package io.druid.common.aws; import com.amazonaws.AmazonClientException; +import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSCredentialsProvider; import com.google.common.base.Strings; @@ -32,10 +33,10 @@ public ConfigDrivenAwsCredentialsConfigProvider(AWSCredentialsConfig config) { } @Override - public com.amazonaws.auth.AWSCredentials getCredentials() + public AWSCredentials getCredentials() { if (!Strings.isNullOrEmpty(config.getAccessKey()) && !Strings.isNullOrEmpty(config.getSecretKey())) { - return new com.amazonaws.auth.AWSCredentials() { + return new AWSCredentials() { @Override public String getAWSAccessKeyId() { return config.getAccessKey(); diff --git a/aws-common/src/main/java/io/druid/common/aws/LazyFileSessionCredentialsProvider.java b/aws-common/src/main/java/io/druid/common/aws/LazyFileSessionCredentialsProvider.java index 297efae8e89c..ccab7ed31456 100644 --- a/aws-common/src/main/java/io/druid/common/aws/LazyFileSessionCredentialsProvider.java +++ b/aws-common/src/main/java/io/druid/common/aws/LazyFileSessionCredentialsProvider.java @@ -19,6 +19,7 @@ package io.druid.common.aws; +import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSCredentialsProvider; public class LazyFileSessionCredentialsProvider implements AWSCredentialsProvider @@ -42,7 +43,7 @@ private FileSessionCredentialsProvider getUnderlyingProvider() { } @Override - public com.amazonaws.auth.AWSCredentials getCredentials() + public AWSCredentials getCredentials() { return getUnderlyingProvider().getCredentials(); } diff --git a/bytebuffer-collections/src/main/java/io/druid/collections/spatial/split/GutmanSplitStrategy.java b/bytebuffer-collections/src/main/java/io/druid/collections/spatial/split/GutmanSplitStrategy.java index fb425f46e100..5dbdb2742d77 100755 --- a/bytebuffer-collections/src/main/java/io/druid/collections/spatial/split/GutmanSplitStrategy.java +++ b/bytebuffer-collections/src/main/java/io/druid/collections/spatial/split/GutmanSplitStrategy.java @@ -53,13 +53,13 @@ public boolean needToSplit(Node node) * * Algorithm Split. Divide a set of M+1 index entries into two groups. * - * S1. [Pick first entry for each group]. Apply Algorithm {@link #pickSeeds(java.util.List)} to choose + * S1. [Pick first entry for each group]. Apply Algorithm {@link #pickSeeds(List)} to choose * two entries to be the first elements of the groups. Assign each to a group. * * S2. [Check if done]. If all entries have been assigned, stop. If one group has so few entries that all the rest * must be assigned to it in order for it to have the minimum number m, assign them and stop. * - * S3. [Select entry to assign]. Invoke Algorithm {@link #pickNext(java.util.List, Node[])} + * S3. [Select entry to assign]. Invoke Algorithm {@link #pickNext(List, Node[])} * to choose the next entry to assign. Add it to the group whose covering rectangle will have to be enlarged least to * accommodate it. Resolve ties by adding the entry to the group smaller area, then to the one with fewer entries, then * to either. Repeat from S2. diff --git a/bytebuffer-collections/src/test/java/io/druid/collections/TestIntegerSet.java b/bytebuffer-collections/src/test/java/io/druid/collections/TestIntegerSet.java index a837bd972b26..1bdfbe284b4a 100755 --- a/bytebuffer-collections/src/test/java/io/druid/collections/TestIntegerSet.java +++ b/bytebuffer-collections/src/test/java/io/druid/collections/TestIntegerSet.java @@ -189,7 +189,7 @@ public void testIntOverflow() throws IllegalAccessException, InstantiationExcept IntegerSet integerSet = IntegerSet.wrap(wrappedBitmap); integerSet.add(Integer.MAX_VALUE + 1); } - catch (java.lang.IllegalArgumentException ex) { + catch (IllegalArgumentException ex) { e = ex; } Assert.assertNotNull(e); diff --git a/common/src/main/java/io/druid/common/config/Log4jShutdown.java b/common/src/main/java/io/druid/common/config/Log4jShutdown.java index fc30acfe572a..a7a2b5507370 100644 --- a/common/src/main/java/io/druid/common/config/Log4jShutdown.java +++ b/common/src/main/java/io/druid/common/config/Log4jShutdown.java @@ -21,6 +21,7 @@ import com.google.common.base.Throwables; import io.druid.java.util.common.ISE; +import org.apache.logging.log4j.core.LifeCycle; import org.apache.logging.log4j.core.util.Cancellable; import org.apache.logging.log4j.core.util.ShutdownCallbackRegistry; @@ -29,7 +30,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicBoolean; -public class Log4jShutdown implements ShutdownCallbackRegistry, org.apache.logging.log4j.core.LifeCycle +public class Log4jShutdown implements ShutdownCallbackRegistry, LifeCycle { private static final long SHUTDOWN_WAIT_TIMEOUT = 60000; diff --git a/common/src/main/java/io/druid/common/utils/VMUtils.java b/common/src/main/java/io/druid/common/utils/VMUtils.java index 1f09ede3bf7a..530f56a23814 100644 --- a/common/src/main/java/io/druid/common/utils/VMUtils.java +++ b/common/src/main/java/io/druid/common/utils/VMUtils.java @@ -49,9 +49,8 @@ public static long safeGetThreadCpuTime() * * @return total CPU time for the current thread in nanoseconds. * - * @throws java.lang.UnsupportedOperationException if the Java - * virtual machine does not support CPU time measurement for - * the current thread. + * @throws UnsupportedOperationException if the Java virtual machine does not support CPU time measurement for + * the current thread. */ public static long getCurrentThreadCpuTime() { diff --git a/extendedset/src/main/java/io/druid/extendedset/intset/ConciseSet.java b/extendedset/src/main/java/io/druid/extendedset/intset/ConciseSet.java index d859c77e74cd..4f28892e7258 100755 --- a/extendedset/src/main/java/io/druid/extendedset/intset/ConciseSet.java +++ b/extendedset/src/main/java/io/druid/extendedset/intset/ConciseSet.java @@ -25,6 +25,7 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.io.Serializable; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; @@ -61,7 +62,7 @@ * @author Alessandro Colantonio * @version $Id$ */ -public class ConciseSet extends AbstractIntSet implements java.io.Serializable +public class ConciseSet extends AbstractIntSet implements Serializable { /** * generated serial ID diff --git a/extendedset/src/main/java/io/druid/extendedset/intset/ImmutableConciseSet.java b/extendedset/src/main/java/io/druid/extendedset/intset/ImmutableConciseSet.java index 34e82974a77a..6347c53f30d6 100755 --- a/extendedset/src/main/java/io/druid/extendedset/intset/ImmutableConciseSet.java +++ b/extendedset/src/main/java/io/druid/extendedset/intset/ImmutableConciseSet.java @@ -21,6 +21,7 @@ import com.google.common.collect.UnmodifiableIterator; import com.google.common.primitives.Ints; import io.druid.extendedset.utilities.IntList; +import org.roaringbitmap.IntIterator; import java.nio.ByteBuffer; import java.nio.IntBuffer; @@ -1000,7 +1001,7 @@ public WordIterator newWordIterator() return new WordIterator(); } - public class WordIterator implements org.roaringbitmap.IntIterator, Cloneable + public class WordIterator implements IntIterator, Cloneable { private int startIndex; private int wordsWalked; diff --git a/extensions-contrib/ambari-metrics-emitter/src/main/java/io/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java b/extensions-contrib/ambari-metrics-emitter/src/main/java/io/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java index 219bc04ec376..8d7a02f2c401 100644 --- a/extensions-contrib/ambari-metrics-emitter/src/main/java/io/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java +++ b/extensions-contrib/ambari-metrics-emitter/src/main/java/io/druid/emitter/ambari/metrics/SendAllTimelineEventConverter.java @@ -30,7 +30,7 @@ import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric; /** - * Emits all the events instance of {@link com.metamx.emitter.service.ServiceMetricEvent}. + * Emits all the events instance of {@link ServiceMetricEvent}. *

* All the dimensions will be retained and lexicographically order using dimensions name. *

diff --git a/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDruidModule.java b/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDruidModule.java index 5597e384f546..a3f61a07f9dc 100644 --- a/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDruidModule.java +++ b/extensions-contrib/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDruidModule.java @@ -20,6 +20,7 @@ package io.druid.storage.cassandra; import com.fasterxml.jackson.core.Version; +import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.Key; @@ -54,10 +55,10 @@ public void configure(Binder binder) } @Override - public List getJacksonModules() + public List getJacksonModules() { return ImmutableList.of( - new com.fasterxml.jackson.databind.Module() + new Module() { @Override public String getModuleName() diff --git a/extensions-contrib/graphite-emitter/src/main/java/io/druid/emitter/graphite/SendAllGraphiteEventConverter.java b/extensions-contrib/graphite-emitter/src/main/java/io/druid/emitter/graphite/SendAllGraphiteEventConverter.java index 5b91cb8266d8..c443b220d127 100644 --- a/extensions-contrib/graphite-emitter/src/main/java/io/druid/emitter/graphite/SendAllGraphiteEventConverter.java +++ b/extensions-contrib/graphite-emitter/src/main/java/io/druid/emitter/graphite/SendAllGraphiteEventConverter.java @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; /** - * Emits all the events instance of {@link com.metamx.emitter.service.ServiceMetricEvent}. + * Emits all the events instance of {@link ServiceMetricEvent}. *

* All the dimensions will be retained and lexicographically order using dimensions name. *

diff --git a/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcIndexGeneratorJobTest.java b/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcIndexGeneratorJobTest.java index ffb058eac76e..114a8924682f 100644 --- a/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcIndexGeneratorJobTest.java +++ b/extensions-contrib/orc-extensions/src/test/java/io/druid/data/input/orc/OrcIndexGeneratorJobTest.java @@ -59,6 +59,7 @@ import org.apache.orc.CompressionKind; import org.apache.orc.OrcFile; import org.apache.orc.TypeDescription; +import org.apache.orc.Writer; import org.joda.time.DateTime; import org.joda.time.DateTimeComparator; import org.joda.time.Interval; @@ -141,7 +142,7 @@ private File writeDataToLocalOrcFile(File outputDir, List data) throws I .addField("host", TypeDescription.createString()) .addField("visited_num", TypeDescription.createInt()); Configuration conf = new Configuration(); - org.apache.orc.Writer writer = OrcFile.createWriter( + Writer writer = OrcFile.createWriter( new Path(outputFile.getPath()), OrcFile.writerOptions(conf) .setSchema(schema) diff --git a/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerConnector.java b/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerConnector.java index c7eae0893eb5..920620acaf6c 100644 --- a/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerConnector.java +++ b/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerConnector.java @@ -126,7 +126,7 @@ public class SQLServerConnector extends SQLMetadataConnector *

* * @see Spring Framework SQLStateSQLExceptionTranslator - * @see java.sql.SQLException#getSQLState() + * @see SQLException#getSQLState() */ private final Set TRANSIENT_SQL_CLASS_CODES = new HashSet<>(Arrays.asList( "08", "53", "54", "57", "58", // Resource Failures @@ -265,7 +265,7 @@ public DBI getDBI() * * {@inheritDoc} * - * @see java.sql.SQLException#getSQLState() + * @see SQLException#getSQLState() * */ @Override diff --git a/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java b/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java index 0f27099dccc7..cc79abb5c7ba 100644 --- a/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java +++ b/extensions-contrib/sqlserver-metadata-storage/src/main/java/io/druid/metadata/storage/sqlserver/SQLServerMetadataStorageModule.java @@ -18,6 +18,7 @@ */ package io.druid.metadata.storage.sqlserver; +import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.Key; @@ -44,7 +45,7 @@ public SQLServerMetadataStorageModule() } @Override - public List getJacksonModules() + public List getJacksonModules() { return ImmutableList.of(); } diff --git a/extensions-core/avro-extensions/src/test/java/io/druid/data/input/AvroStreamInputRowParserTest.java b/extensions-core/avro-extensions/src/test/java/io/druid/data/input/AvroStreamInputRowParserTest.java index e8d24e76012e..003c59261c51 100644 --- a/extensions-core/avro-extensions/src/test/java/io/druid/data/input/AvroStreamInputRowParserTest.java +++ b/extensions-core/avro-extensions/src/test/java/io/druid/data/input/AvroStreamInputRowParserTest.java @@ -19,6 +19,7 @@ package io.druid.data.input; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.google.common.base.Function; @@ -121,7 +122,7 @@ public void before() { jsonMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); jsonMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - for (com.fasterxml.jackson.databind.Module jacksonModule : new AvroExtensionsModule().getJacksonModules()) { + for (Module jacksonModule : new AvroExtensionsModule().getJacksonModules()) { jsonMapper.registerModule(jacksonModule); } } diff --git a/extensions-core/caffeine-cache/src/main/java/io/druid/client/cache/CaffeineCache.java b/extensions-core/caffeine-cache/src/main/java/io/druid/client/cache/CaffeineCache.java index fa9ca1493586..ba4688a3ef44 100644 --- a/extensions-core/caffeine-cache/src/main/java/io/druid/client/cache/CaffeineCache.java +++ b/extensions-core/caffeine-cache/src/main/java/io/druid/client/cache/CaffeineCache.java @@ -118,7 +118,7 @@ public void close(String namespace) @Override public io.druid.client.cache.CacheStats getStats() { - final com.github.benmanes.caffeine.cache.stats.CacheStats stats = cache.stats(); + final CacheStats stats = cache.stats(); final long size = cache .policy().eviction() .map(eviction -> eviction.isWeighted() ? eviction.weightedSize() : OptionalLong.empty()) diff --git a/extensions-core/kafka-extraction-namespace/src/main/java/io/druid/query/lookup/KafkaLookupExtractorFactory.java b/extensions-core/kafka-extraction-namespace/src/main/java/io/druid/query/lookup/KafkaLookupExtractorFactory.java index ebd99c430ade..8e1d8bd38c97 100644 --- a/extensions-core/kafka-extraction-namespace/src/main/java/io/druid/query/lookup/KafkaLookupExtractorFactory.java +++ b/extensions-core/kafka-extraction-namespace/src/main/java/io/druid/query/lookup/KafkaLookupExtractorFactory.java @@ -43,6 +43,7 @@ import kafka.consumer.KafkaStream; import kafka.consumer.Whitelist; import kafka.javaapi.consumer.ConsumerConnector; +import kafka.javaapi.consumer.ZookeeperConsumerConnector; import kafka.message.MessageAndMetadata; import kafka.serializer.Decoder; @@ -294,7 +295,7 @@ public void onFailure(Throwable t) // Overridden in tests ConsumerConnector buildConnector(Properties properties) { - return new kafka.javaapi.consumer.ZookeeperConsumerConnector( + return new ZookeeperConsumerConnector( new ConsumerConfig(properties) ); } diff --git a/extensions-core/kafka-extraction-namespace/src/test/java/io/druid/query/lookup/TestKafkaExtractionCluster.java b/extensions-core/kafka-extraction-namespace/src/test/java/io/druid/query/lookup/TestKafkaExtractionCluster.java index ca7b94a2fc05..6c9ad105417c 100644 --- a/extensions-core/kafka-extraction-namespace/src/test/java/io/druid/query/lookup/TestKafkaExtractionCluster.java +++ b/extensions-core/kafka-extraction-namespace/src/test/java/io/druid/query/lookup/TestKafkaExtractionCluster.java @@ -42,6 +42,7 @@ import kafka.utils.Time; import kafka.utils.ZKStringSerializer$; import org.I0Itec.zkclient.ZkClient; +import org.I0Itec.zkclient.exception.ZkException; import org.apache.curator.test.TestingServer; import org.apache.zookeeper.CreateMode; import org.joda.time.DateTime; @@ -199,7 +200,7 @@ public void close() throws Exception try { zkClient.deleteRecursive(zkKafkaPath); } - catch (org.I0Itec.zkclient.exception.ZkException ex) { + catch (ZkException ex) { log.warn(ex, "error deleting %s zk node", zkKafkaPath); } } diff --git a/extensions-core/lookups-cached-global/src/main/java/io/druid/server/lookup/namespace/cache/CacheScheduler.java b/extensions-core/lookups-cached-global/src/main/java/io/druid/server/lookup/namespace/cache/CacheScheduler.java index 652c0d91df48..d135b0e48835 100644 --- a/extensions-core/lookups-cached-global/src/main/java/io/druid/server/lookup/namespace/cache/CacheScheduler.java +++ b/extensions-core/lookups-cached-global/src/main/java/io/druid/server/lookup/namespace/cache/CacheScheduler.java @@ -453,8 +453,8 @@ public void run() } /** - * This method should be used from {@link io.druid.query.lookup.namespace.CacheGenerator#generateCache} implementations, to obtain - * a {@link VersionedCache} to be returned. + * This method should be used from {@link CacheGenerator#generateCache} implementations, to obtain a {@link + * VersionedCache} to be returned. * * @param entryId an object uniquely corresponding to the {@link CacheScheduler.Entry}, for which VersionedCache is * created diff --git a/extensions-core/mysql-metadata-storage/src/main/java/io/druid/metadata/storage/mysql/MySQLMetadataStorageModule.java b/extensions-core/mysql-metadata-storage/src/main/java/io/druid/metadata/storage/mysql/MySQLMetadataStorageModule.java index 4a86dd627bd1..1aad097dc772 100644 --- a/extensions-core/mysql-metadata-storage/src/main/java/io/druid/metadata/storage/mysql/MySQLMetadataStorageModule.java +++ b/extensions-core/mysql-metadata-storage/src/main/java/io/druid/metadata/storage/mysql/MySQLMetadataStorageModule.java @@ -19,6 +19,7 @@ package io.druid.metadata.storage.mysql; +import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.Key; @@ -43,7 +44,7 @@ public MySQLMetadataStorageModule() } @Override - public List getJacksonModules() + public List getJacksonModules() { return ImmutableList.of(); } diff --git a/extensions-core/postgresql-metadata-storage/src/main/java/io/druid/metadata/storage/postgresql/PostgreSQLMetadataStorageModule.java b/extensions-core/postgresql-metadata-storage/src/main/java/io/druid/metadata/storage/postgresql/PostgreSQLMetadataStorageModule.java index e815682d4d02..161022b3e10b 100644 --- a/extensions-core/postgresql-metadata-storage/src/main/java/io/druid/metadata/storage/postgresql/PostgreSQLMetadataStorageModule.java +++ b/extensions-core/postgresql-metadata-storage/src/main/java/io/druid/metadata/storage/postgresql/PostgreSQLMetadataStorageModule.java @@ -19,6 +19,7 @@ package io.druid.metadata.storage.postgresql; +import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.Key; @@ -44,7 +45,7 @@ public PostgreSQLMetadataStorageModule() } @Override - public List getJacksonModules() + public List getJacksonModules() { return ImmutableList.of(); } diff --git a/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/S3StorageDruidModule.java b/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/S3StorageDruidModule.java index 301aae0494a8..c9c0568f088d 100644 --- a/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/S3StorageDruidModule.java +++ b/extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/S3StorageDruidModule.java @@ -20,6 +20,7 @@ package io.druid.storage.s3; import com.amazonaws.auth.AWSCredentialsProvider; +import com.amazonaws.auth.AWSSessionCredentials; import com.fasterxml.jackson.core.Version; import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; @@ -103,7 +104,7 @@ public void configure(Binder binder) @LazySingleton public RestS3Service getRestS3Service(AWSCredentialsProvider provider) { - if (provider.getCredentials() instanceof com.amazonaws.auth.AWSSessionCredentials) { + if (provider.getCredentials() instanceof AWSSessionCredentials) { return new RestS3Service(new AWSSessionCredentialsAdapter(provider)); } else { return new RestS3Service(new AWSCredentials( diff --git a/indexing-hadoop/src/test/java/io/druid/indexer/hadoop/DatasourceInputFormatTest.java b/indexing-hadoop/src/test/java/io/druid/indexer/hadoop/DatasourceInputFormatTest.java index 616d364a0452..59843aaa9bd3 100644 --- a/indexing-hadoop/src/test/java/io/druid/indexer/hadoop/DatasourceInputFormatTest.java +++ b/indexing-hadoop/src/test/java/io/druid/indexer/hadoop/DatasourceInputFormatTest.java @@ -357,8 +357,8 @@ public void testGetFrequentLocationsMoreThan3() @Test public void testGetLocationsInputFormatException() throws IOException { - final org.apache.hadoop.mapred.InputFormat fio = EasyMock.mock( - org.apache.hadoop.mapred.InputFormat.class + final InputFormat fio = EasyMock.mock( + InputFormat.class ); EasyMock.expect(fio.getSplits(config, 1)).andThrow(new IOException("testing")); @@ -373,8 +373,8 @@ public void testGetLocationsInputFormatException() throws IOException @Test public void testGetLocationsSplitException() throws IOException { - final org.apache.hadoop.mapred.InputFormat fio = EasyMock.mock( - org.apache.hadoop.mapred.InputFormat.class + final InputFormat fio = EasyMock.mock( + InputFormat.class ); final org.apache.hadoop.mapred.InputSplit split = EasyMock.mock( @@ -397,8 +397,8 @@ public void testGetLocationsSplitException() throws IOException @Test public void testGetLocations() throws IOException { - final org.apache.hadoop.mapred.InputFormat fio = EasyMock.mock( - org.apache.hadoop.mapred.InputFormat.class + final InputFormat fio = EasyMock.mock( + InputFormat.class ); final org.apache.hadoop.mapred.InputSplit split = EasyMock.mock( diff --git a/indexing-service/src/main/java/io/druid/indexing/common/actions/SegmentInsertAction.java b/indexing-service/src/main/java/io/druid/indexing/common/actions/SegmentInsertAction.java index d73c073c9dda..87294023c0bc 100644 --- a/indexing-service/src/main/java/io/druid/indexing/common/actions/SegmentInsertAction.java +++ b/indexing-service/src/main/java/io/druid/indexing/common/actions/SegmentInsertAction.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.google.common.collect.ImmutableSet; import io.druid.indexing.common.task.Task; -import io.druid.indexing.overlord.DataSourceMetadata; import io.druid.timeline.DataSegment; import java.io.IOException; @@ -66,7 +65,7 @@ public TypeReference> getReturnTypeReference() /** * Behaves similarly to - * {@link io.druid.indexing.overlord.IndexerMetadataStorageCoordinator#announceHistoricalSegments(Set, DataSourceMetadata, DataSourceMetadata)}, + * {@link io.druid.indexing.overlord.IndexerMetadataStorageCoordinator#announceHistoricalSegments}, * with startMetadata and endMetadata both null. */ @Override diff --git a/indexing-service/src/main/java/io/druid/indexing/common/task/Task.java b/indexing-service/src/main/java/io/druid/indexing/common/task/Task.java index 7f57c0e7662b..39210ad91229 100644 --- a/indexing-service/src/main/java/io/druid/indexing/common/task/Task.java +++ b/indexing-service/src/main/java/io/druid/indexing/common/task/Task.java @@ -79,10 +79,10 @@ public interface Task public String getGroupId(); /** - * Returns a {@link io.druid.indexing.common.task.TaskResource} for this task. Task resources define specific - * worker requirements a task may require. + * Returns a {@link TaskResource} for this task. Task resources define specific worker requirements a task may + * require. * - * @return {@link io.druid.indexing.common.task.TaskResource} for this task + * @return {@link TaskResource} for this task */ public TaskResource getTaskResource(); diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskLockbox.java b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskLockbox.java index 7d00532d1f72..eae79c8add18 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskLockbox.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskLockbox.java @@ -97,7 +97,7 @@ public TaskLockbox( } /** - * Wipe out our current in-memory state and resync it from our bundled {@link io.druid.indexing.overlord.TaskStorage}. + * Wipe out our current in-memory state and resync it from our bundled {@link TaskStorage}. */ public void syncFromStorage() { @@ -196,7 +196,7 @@ public int compare(Pair left, Pair right) * @param interval interval to lock * @return acquired TaskLock * - * @throws java.lang.InterruptedException if the lock cannot be acquired + * @throws InterruptedException if the lock cannot be acquired */ public TaskLock lock(final Task task, final Interval interval) throws InterruptedException { diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskQueue.java b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskQueue.java index ef4fafabcfe9..1fabf2bf7190 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskQueue.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskQueue.java @@ -305,7 +305,7 @@ public String apply(Task task) * * @return true * - * @throws io.druid.metadata.EntryExistsException if the task already exists + * @throws EntryExistsException if the task already exists */ public boolean add(final Task task) throws EntryExistsException { diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskRunner.java b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskRunner.java index 168b0d852078..51b4e45de1af 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskRunner.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskRunner.java @@ -32,7 +32,7 @@ import java.util.concurrent.Executor; /** - * Interface for handing off tasks. Managed by a {@link io.druid.indexing.overlord.TaskQueue}. + * Interface for handing off tasks. Managed by a {@link TaskQueue}. * Holds state */ public interface TaskRunner diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskStorage.java b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskStorage.java index dc5986092e00..8e662bab130c 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/TaskStorage.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/TaskStorage.java @@ -35,7 +35,7 @@ public interface TaskStorage * * @param task task to add * @param status task status - * @throws io.druid.metadata.EntryExistsException if the task ID already exists + * @throws EntryExistsException if the task ID already exists */ public void insert(Task task, TaskStatus status) throws EntryExistsException; diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/setup/WorkerSelectStrategy.java b/indexing-service/src/main/java/io/druid/indexing/overlord/setup/WorkerSelectStrategy.java index 87fcfb69c5bc..d58de1d6b7b5 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/setup/WorkerSelectStrategy.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/setup/WorkerSelectStrategy.java @@ -47,7 +47,7 @@ public interface WorkerSelectStrategy * @param zkWorkers An immutable map of workers to choose from. * @param task The task to assign. * - * @return A {@link io.druid.indexing.overlord.ImmutableWorkerInfo} to run the task if one is available. + * @return A {@link ImmutableWorkerInfo} to run the task if one is available. */ Optional findWorkerForTask( final WorkerTaskRunnerConfig config, diff --git a/indexing-service/src/test/java/io/druid/indexing/overlord/config/ForkingTaskRunnerConfigTest.java b/indexing-service/src/test/java/io/druid/indexing/overlord/config/ForkingTaskRunnerConfigTest.java index 73fb97421846..5b311761468d 100644 --- a/indexing-service/src/test/java/io/druid/indexing/overlord/config/ForkingTaskRunnerConfigTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/overlord/config/ForkingTaskRunnerConfigTest.java @@ -26,6 +26,7 @@ import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.Module; +import com.google.inject.ProvisionException; import com.google.inject.name.Names; import io.druid.guice.GuiceInjectors; import io.druid.guice.IndexingServiceModuleHelper; @@ -144,19 +145,19 @@ public void testCrazyJavaOptArray() throws JsonProcessingException ); } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testExceptionalJavaOptArray() throws JsonProcessingException { buildFromProperties(ForkingTaskRunnerConfig.JAVA_OPTS_ARRAY_PROPERTY, "not an array"); } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testExceptionalJavaOpt() throws JsonProcessingException { buildFromProperties(ForkingTaskRunnerConfig.JAVA_OPTS_PROPERTY, "[\"not a string\"]"); } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testExceptionalJavaOpt2() throws JsonProcessingException { buildFromProperties(ForkingTaskRunnerConfig.JAVA_OPTS_PROPERTY, "{\"not a string\":\"someVal\"}"); diff --git a/integration-tests/src/main/java/org/testng/TestNG.java b/integration-tests/src/main/java/org/testng/TestNG.java index 170382b4e321..9535883b772f 100644 --- a/integration-tests/src/main/java/org/testng/TestNG.java +++ b/integration-tests/src/main/java/org/testng/TestNG.java @@ -283,7 +283,7 @@ public void setOutputDirectory(final String outputdir) * * @see org.testng.reporters.TestHTMLReporter * @see org.testng.reporters.JUnitXMLReporter - * @see org.testng.reporters.XMLReporter + * @see XMLReporter */ public void setUseDefaultListeners(boolean useDefaultListeners) { @@ -701,7 +701,7 @@ public void setTestSuites(List suites) * * @param suites * - * @see org.testng.xml.XmlSuite + * @see XmlSuite */ public void setXmlSuites(List suites) { @@ -2116,7 +2116,7 @@ private void setHasRunTests() } /** - * @see org.testng.IConfigurationListener#onConfigurationFailure(org.testng.ITestResult) + * @see IConfigurationListener#onConfigurationFailure(ITestResult) */ @Override public void onConfigurationFailure(ITestResult itr) @@ -2125,7 +2125,7 @@ public void onConfigurationFailure(ITestResult itr) } /** - * @see org.testng.IConfigurationListener#onConfigurationSkip(org.testng.ITestResult) + * @see IConfigurationListener#onConfigurationSkip(ITestResult) */ @Override public void onConfigurationSkip(ITestResult itr) @@ -2134,7 +2134,7 @@ public void onConfigurationSkip(ITestResult itr) } /** - * @see org.testng.IConfigurationListener#onConfigurationSuccess(org.testng.ITestResult) + * @see IConfigurationListener#onConfigurationSuccess(ITestResult) */ @Override public void onConfigurationSuccess(ITestResult itr) diff --git a/java-util/src/main/java/io/druid/java/util/common/CompressionUtils.java b/java-util/src/main/java/io/druid/java/util/common/CompressionUtils.java index eb4360da0f2f..a031ed06891f 100644 --- a/java-util/src/main/java/io/druid/java/util/common/CompressionUtils.java +++ b/java-util/src/main/java/io/druid/java/util/common/CompressionUtils.java @@ -489,7 +489,7 @@ public static boolean isGz(String fName) * * @return fname without the ".gz" extension * - * @throws io.druid.java.util.common.IAE if fname is not a valid "*.gz" file name + * @throws IAE if fname is not a valid "*.gz" file name */ public static String getGzBaseName(String fname) { diff --git a/java-util/src/main/java/io/druid/java/util/common/FileUtils.java b/java-util/src/main/java/io/druid/java/util/common/FileUtils.java index a79cb13f8a60..72be3a57e18f 100644 --- a/java-util/src/main/java/io/druid/java/util/common/FileUtils.java +++ b/java-util/src/main/java/io/druid/java/util/common/FileUtils.java @@ -54,7 +54,7 @@ public boolean apply(Throwable input) * @param shouldRetry Predicate indicating if an error is recoverable and should be retried. * @param maxAttempts The maximum number of assumed recoverable attempts to try before completely failing. * - * @throws java.lang.RuntimeException wrapping the inner exception on failure. + * @throws RuntimeException wrapping the inner exception on failure. */ public static FileCopyResult retryCopy( final ByteSource byteSource, @@ -135,7 +135,7 @@ public void addFile(File file) /** * Fully maps a file read-only in to memory as per - * {@link FileChannel#map(java.nio.channels.FileChannel.MapMode, long, long)}. + * {@link FileChannel#map(FileChannel.MapMode, long, long)}. * *

Files are mapped from offset 0 to its length. * diff --git a/java-util/src/test/java/io/druid/java/util/common/CompressionUtilsTest.java b/java-util/src/test/java/io/druid/java/util/common/CompressionUtilsTest.java index f43c50e2f763..27cc850abf34 100644 --- a/java-util/src/test/java/io/druid/java/util/common/CompressionUtilsTest.java +++ b/java-util/src/test/java/io/druid/java/util/common/CompressionUtilsTest.java @@ -308,7 +308,7 @@ public void testZeroRemainingInputStream() throws IOException } // If this ever passes, er... fails to fail... then the bug is fixed - @Test(expected = java.lang.AssertionError.class) + @Test(expected = AssertionError.class) // http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7036144 public void testGunzipBug() throws IOException { diff --git a/java-util/src/test/java/io/druid/java/util/common/StringUtilsTest.java b/java-util/src/test/java/io/druid/java/util/common/StringUtilsTest.java index 2ba4875ee9a4..30cea273b722 100644 --- a/java-util/src/test/java/io/druid/java/util/common/StringUtilsTest.java +++ b/java-util/src/test/java/io/druid/java/util/common/StringUtilsTest.java @@ -23,6 +23,7 @@ import org.junit.Test; import java.io.UnsupportedEncodingException; +import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; /** @@ -70,7 +71,7 @@ public void testMiddleOfByteArrayConversion() } - @Test(expected = java.nio.BufferUnderflowException.class) + @Test(expected = BufferUnderflowException.class) public void testOutOfBounds() { ByteBuffer bytes = ByteBuffer.wrap(new byte[]{'a', 'b', 'c', 'd'}); @@ -78,13 +79,13 @@ public void testOutOfBounds() StringUtils.fromUtf8(bytes, 3); } - @Test(expected = java.lang.NullPointerException.class) + @Test(expected = NullPointerException.class) public void testNullPointerByteBuffer() { StringUtils.fromUtf8((ByteBuffer) null); } - @Test(expected = java.lang.NullPointerException.class) + @Test(expected = NullPointerException.class) public void testNullPointerByteArray() { StringUtils.fromUtf8((byte[]) null); diff --git a/java-util/src/test/java/io/druid/java/util/common/parsers/JavaScriptParserTest.java b/java-util/src/test/java/io/druid/java/util/common/parsers/JavaScriptParserTest.java index dd9099ec0264..a0bf7d6346e0 100644 --- a/java-util/src/test/java/io/druid/java/util/common/parsers/JavaScriptParserTest.java +++ b/java-util/src/test/java/io/druid/java/util/common/parsers/JavaScriptParserTest.java @@ -23,6 +23,7 @@ import com.google.common.collect.Lists; import junit.framework.Assert; import org.junit.Test; +import org.mozilla.javascript.EvaluatorException; import java.util.Map; @@ -71,7 +72,7 @@ public void testParseWithMultiVal() ); } - @Test(expected = org.mozilla.javascript.EvaluatorException.class) + @Test(expected = EvaluatorException.class) public void testFailure() { final String function = "i am bad javascript"; diff --git a/pom.xml b/pom.xml index 4405e7f9b417..52b59b26d572 100644 --- a/pom.xml +++ b/pom.xml @@ -890,6 +890,29 @@ + + org.apache.maven.plugins + maven-pmd-plugin + 3.8 + + true + + /rulesets/java/imports.xml + + + target/generated-sources/ + + + + + validate + validate + + check + + + + org.codehaus.mojo animal-sniffer-maven-plugin diff --git a/processing/src/main/java/io/druid/query/BitmapResultFactory.java b/processing/src/main/java/io/druid/query/BitmapResultFactory.java index 2eade4ef7821..13235f9bed84 100644 --- a/processing/src/main/java/io/druid/query/BitmapResultFactory.java +++ b/processing/src/main/java/io/druid/query/BitmapResultFactory.java @@ -24,9 +24,9 @@ /** * BitmapResultFactory is an abstraction that allows to record something along with preFilter bitmap construction, and - * emit this information as dimension(s) of query metrics. BitmapResultFactory is similar to {@link - * io.druid.collections.bitmap.BitmapFactory}: it has the same methods with the exception that it accepts generic type - * T (bitmap wrapper type) instead of {@link ImmutableBitmap}. + * emit this information as dimension(s) of query metrics. BitmapResultFactory is similar to {@link BitmapFactory}: it + * has the same methods with the exception that it accepts generic type T (bitmap wrapper type) instead of {@link + * ImmutableBitmap}. * * {@link DefaultBitmapResultFactory} is a no-op implementation, where "wrapper" type is {@code ImmutableBitmap} itself. * diff --git a/processing/src/main/java/io/druid/query/Druids.java b/processing/src/main/java/io/druid/query/Druids.java index da81fa9a80ac..0c942a7a3cc0 100644 --- a/processing/src/main/java/io/druid/query/Druids.java +++ b/processing/src/main/java/io/druid/query/Druids.java @@ -325,7 +325,7 @@ public static NoopDimFilterBuilder newNoopDimFilterBuilder() * .build(); * * - * @see io.druid.query.timeseries.TimeseriesQuery + * @see TimeseriesQuery */ public static class TimeseriesQueryBuilder { @@ -544,7 +544,7 @@ public static TimeseriesQueryBuilder newTimeseriesQueryBuilder() * .build(); * * - * @see io.druid.query.search.search.SearchQuery + * @see SearchQuery */ public static class SearchQueryBuilder { @@ -766,7 +766,7 @@ public static SearchQueryBuilder newSearchQueryBuilder() * .build(); * * - * @see io.druid.query.timeboundary.TimeBoundaryQuery + * @see TimeBoundaryQuery */ public static class TimeBoundaryQueryBuilder { @@ -951,7 +951,7 @@ public static ResultBuilder newTimeBoundaryResultBuilde * .build(); * * - * @see io.druid.query.metadata.metadata.SegmentMetadataQuery + * @see SegmentMetadataQuery */ public static class SegmentMetadataQueryBuilder { @@ -1091,7 +1091,7 @@ public static SegmentMetadataQueryBuilder newSegmentMetadataQueryBuilder() * .build(); * * - * @see io.druid.query.select.SelectQuery + * @see SelectQuery */ public static class SelectQueryBuilder { @@ -1281,7 +1281,7 @@ public static SelectQueryBuilder newSelectQueryBuilder() * .build(); * * - * @see io.druid.query.datasourcemetadata.DataSourceMetadataQuery + * @see DataSourceMetadataQuery */ public static class DataSourceMetadataQueryBuilder { diff --git a/processing/src/main/java/io/druid/query/extraction/ExtractionFn.java b/processing/src/main/java/io/druid/query/extraction/ExtractionFn.java index 4518a4cf8ef4..3a8820a4e5b9 100644 --- a/processing/src/main/java/io/druid/query/extraction/ExtractionFn.java +++ b/processing/src/main/java/io/druid/query/extraction/ExtractionFn.java @@ -116,8 +116,7 @@ public interface ExtractionFn * modified into another unique value. In the `MANY_TO_ONE` case, there is no longer a 1:1 relation between old dimension * value and new dimension value * - * @return {@link io.druid.query.extraction.ExtractionFn.ExtractionType} declaring what kind of manipulation this - * function does + * @return {@link ExtractionFn.ExtractionType} declaring what kind of manipulation this function does */ public ExtractionType getExtractionType(); diff --git a/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java b/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java index 3741f40f9a8d..c60e6b022bc3 100644 --- a/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java @@ -29,7 +29,7 @@ import java.nio.ByteBuffer; /** - * This class is deprecated, use SelectorDimFilter instead: {@link io.druid.query.filter.SelectorDimFilter} + * This class is deprecated, use SelectorDimFilter instead: {@link SelectorDimFilter} */ @Deprecated public class ExtractionDimFilter implements DimFilter diff --git a/processing/src/main/java/io/druid/query/topn/TopNQueryBuilder.java b/processing/src/main/java/io/druid/query/topn/TopNQueryBuilder.java index 4a06a486f390..1821a502687f 100644 --- a/processing/src/main/java/io/druid/query/topn/TopNQueryBuilder.java +++ b/processing/src/main/java/io/druid/query/topn/TopNQueryBuilder.java @@ -61,7 +61,7 @@ * .build(); * * - * @see io.druid.query.topn.TopNQuery + * @see TopNQuery */ public class TopNQueryBuilder { diff --git a/processing/src/main/java/io/druid/query/topn/TopNQueryMetrics.java b/processing/src/main/java/io/druid/query/topn/TopNQueryMetrics.java index aedb47d6eebd..6a70b8dcf44f 100644 --- a/processing/src/main/java/io/druid/query/topn/TopNQueryMetrics.java +++ b/processing/src/main/java/io/druid/query/topn/TopNQueryMetrics.java @@ -23,8 +23,6 @@ import io.druid.segment.ColumnValueSelector; import io.druid.segment.Cursor; -import java.util.List; - /** * Specialization of {@link QueryMetrics} for {@link TopNQuery}. */ @@ -74,7 +72,7 @@ public interface TopNQueryMetrics extends QueryMetrics /** * Called with the number of rows, processed via each cursor, processed for the query within the segment. The total * number of processed rows, reported via this method for a TopNQueryMetrics instance, is smaller or equal to - * {@link #reportPreFilteredRows(long)}, because {@link #postFilters(List)} are additionally applied. If there + * {@link #reportPreFilteredRows(long)}, because {@link #postFilters} are additionally applied. If there * are no postFilters, preFilteredRows and processedRows are equal. */ TopNQueryMetrics addProcessedRows(long numRows); diff --git a/processing/src/main/java/io/druid/segment/IndexMerger.java b/processing/src/main/java/io/druid/segment/IndexMerger.java index 88b33b381be6..0be3ba8b2e8e 100644 --- a/processing/src/main/java/io/druid/segment/IndexMerger.java +++ b/processing/src/main/java/io/druid/segment/IndexMerger.java @@ -167,7 +167,7 @@ static > ArrayList mergeIndexed(List { private Emitter emitter; private Injector injector; - @com.google.inject.Inject + @Inject public void configure(Injector injector) { this.injector = injector; emitter = injector.getInstance(Emitter.class); diff --git a/processing/src/test/java/io/druid/query/extraction/StringFormatExtractionFnTest.java b/processing/src/test/java/io/druid/query/extraction/StringFormatExtractionFnTest.java index d6f52fc8582d..f82c07feb2f1 100644 --- a/processing/src/test/java/io/druid/query/extraction/StringFormatExtractionFnTest.java +++ b/processing/src/test/java/io/druid/query/extraction/StringFormatExtractionFnTest.java @@ -25,6 +25,8 @@ import org.junit.Assert; import org.junit.Test; +import java.io.IOException; + /** * */ @@ -85,7 +87,7 @@ public StringFormatExtractionFn format(String format, String nullHandling) return new StringFormatExtractionFn(format, StringFormatExtractionFn.NullHandling.forValue(nullHandling)); } - private void validateSerde(String json) throws java.io.IOException + private void validateSerde(String json) throws IOException { final ObjectMapper objectMapper = new DefaultObjectMapper(); StringFormatExtractionFn extractionFn = (StringFormatExtractionFn) objectMapper.readValue(json, ExtractionFn.class); diff --git a/processing/src/test/java/io/druid/query/spec/SpecificSegmentQueryRunnerTest.java b/processing/src/test/java/io/druid/query/spec/SpecificSegmentQueryRunnerTest.java index 26adab13fb8e..76564445abc9 100644 --- a/processing/src/test/java/io/druid/query/spec/SpecificSegmentQueryRunnerTest.java +++ b/processing/src/test/java/io/druid/query/spec/SpecificSegmentQueryRunnerTest.java @@ -48,6 +48,7 @@ import org.junit.Assert; import org.junit.Test; +import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Map; @@ -202,7 +203,7 @@ public void run() } private void validate(ObjectMapper mapper, SegmentDescriptor descriptor, Map responseContext) - throws java.io.IOException + throws IOException { Object missingSegments = responseContext.get(Result.MISSING_SEGMENTS_KEY); diff --git a/processing/src/test/java/io/druid/segment/MergeIntIteratorTest.java b/processing/src/test/java/io/druid/segment/MergeIntIteratorTest.java index 9c0562ff7ffd..41b7fa8a4e17 100644 --- a/processing/src/test/java/io/druid/segment/MergeIntIteratorTest.java +++ b/processing/src/test/java/io/druid/segment/MergeIntIteratorTest.java @@ -71,7 +71,7 @@ private static void assertEmpty(IntIterator it) } /** - * Check for some possible corner cases, because {@link io.druid.segment.IntIteratorUtils.MergeIntIterator} is + * Check for some possible corner cases, because {@link IntIteratorUtils.MergeIntIterator} is * implemented using packing ints within longs, that is prone to some overflow or sign bit extension bugs */ @Test diff --git a/server/src/main/java/io/druid/client/HttpServerInventoryView.java b/server/src/main/java/io/druid/client/HttpServerInventoryView.java index 06e3009d3ef6..68c7cac3d711 100644 --- a/server/src/main/java/io/druid/client/HttpServerInventoryView.java +++ b/server/src/main/java/io/druid/client/HttpServerInventoryView.java @@ -288,7 +288,7 @@ public Iterable getInventory() { synchronized (servers) { return Iterables.transform( - servers.values(), new com.google.common.base.Function() + servers.values(), new Function() { @Override public DruidServer apply(DruidServerHolder input) diff --git a/server/src/main/java/io/druid/curator/discovery/CuratorServiceUtils.java b/server/src/main/java/io/druid/curator/discovery/CuratorServiceUtils.java index 21b8d42411d6..225111b1f5a7 100644 --- a/server/src/main/java/io/druid/curator/discovery/CuratorServiceUtils.java +++ b/server/src/main/java/io/druid/curator/discovery/CuratorServiceUtils.java @@ -30,8 +30,8 @@ public class CuratorServiceUtils * Mapping the actual service name to the name used within curator should be left to {@link CuratorServiceAnnouncer} * and {@link ServerDiscoveryFactory} * - * @see io.druid.curator.discovery.CuratorServiceAnnouncer - * @see io.druid.curator.discovery.ServerDiscoveryFactory + * @see CuratorServiceAnnouncer + * @see ServerDiscoveryFactory * * @param serviceName * @return diff --git a/server/src/main/java/io/druid/guice/LocalDataStorageDruidModule.java b/server/src/main/java/io/druid/guice/LocalDataStorageDruidModule.java index 3d5afaba1118..e96c1046507a 100644 --- a/server/src/main/java/io/druid/guice/LocalDataStorageDruidModule.java +++ b/server/src/main/java/io/druid/guice/LocalDataStorageDruidModule.java @@ -20,6 +20,7 @@ package io.druid.guice; import com.fasterxml.jackson.core.Version; +import com.fasterxml.jackson.databind.Module; import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.Key; @@ -96,10 +97,10 @@ private static void bindDeepStorageLocal(Binder binder) } @Override - public List getJacksonModules() + public List getJacksonModules() { return ImmutableList.of( - new com.fasterxml.jackson.databind.Module() + new Module() { @Override public String getModuleName() diff --git a/server/src/main/java/io/druid/guice/ServerModule.java b/server/src/main/java/io/druid/guice/ServerModule.java index 44c5f73b2892..b787092953a0 100644 --- a/server/src/main/java/io/druid/guice/ServerModule.java +++ b/server/src/main/java/io/druid/guice/ServerModule.java @@ -19,6 +19,7 @@ package io.druid.guice; +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; @@ -58,7 +59,7 @@ public ScheduledExecutorFactory getScheduledExecutorFactory(Lifecycle lifecycle) } @Override - public List getJacksonModules() + public List getJacksonModules() { return Collections.singletonList( new SimpleModule() diff --git a/server/src/main/java/io/druid/initialization/Initialization.java b/server/src/main/java/io/druid/initialization/Initialization.java index 843b5c4e345e..6c92dac3c8c2 100644 --- a/server/src/main/java/io/druid/initialization/Initialization.java +++ b/server/src/main/java/io/druid/initialization/Initialization.java @@ -122,8 +122,8 @@ static Map getLoadersMap() /** * Look for implementations for the given class from both classpath and extensions directory, using {@link - * java.util.ServiceLoader}. A user should never put the same two extensions in classpath and extensions directory, if - * he/she does that, the one that is in the classpath will be loaded, the other will be ignored. + * ServiceLoader}. A user should never put the same two extensions in classpath and extensions directory, if he/she + * does that, the one that is in the classpath will be loaded, the other will be ignored. * * @param config Extensions configuration * @param serviceClass The class to look the implementations of (e.g., DruidModule) diff --git a/server/src/main/java/io/druid/segment/realtime/firehose/EventReceiverFirehoseFactory.java b/server/src/main/java/io/druid/segment/realtime/firehose/EventReceiverFirehoseFactory.java index 1cf9911c7c26..6e462f6b3099 100644 --- a/server/src/main/java/io/druid/segment/realtime/firehose/EventReceiverFirehoseFactory.java +++ b/server/src/main/java/io/druid/segment/realtime/firehose/EventReceiverFirehoseFactory.java @@ -68,8 +68,8 @@ import java.util.concurrent.atomic.AtomicLong; /** - * Builds firehoses that accept events through the {@link io.druid.segment.realtime.firehose.EventReceiver} interface. Can also register these - * firehoses with an {@link io.druid.segment.realtime.firehose.ServiceAnnouncingChatHandlerProvider}. + * Builds firehoses that accept events through the {@link EventReceiver} interface. Can also register these + * firehoses with an {@link ServiceAnnouncingChatHandlerProvider}. */ public class EventReceiverFirehoseFactory implements FirehoseFactory { diff --git a/server/src/main/java/io/druid/server/listener/announcer/ListenerDiscoverer.java b/server/src/main/java/io/druid/server/listener/announcer/ListenerDiscoverer.java index e32669e1fe16..63243c14a7a3 100644 --- a/server/src/main/java/io/druid/server/listener/announcer/ListenerDiscoverer.java +++ b/server/src/main/java/io/druid/server/listener/announcer/ListenerDiscoverer.java @@ -109,7 +109,7 @@ Map getCurrentNodes(final String listener_key) thro try { children = cf.getChildren().forPath(zkPath); } - catch (org.apache.zookeeper.KeeperException.NoNodeException e) { + catch (KeeperException.NoNodeException e) { LOG.debug(e, "No path found at [%s]", zkPath); return ImmutableMap.of(); } diff --git a/server/src/test/java/io/druid/client/cache/CacheConfigTest.java b/server/src/test/java/io/druid/client/cache/CacheConfigTest.java index 1da321851d0d..cd143816777b 100644 --- a/server/src/test/java/io/druid/client/cache/CacheConfigTest.java +++ b/server/src/test/java/io/druid/client/cache/CacheConfigTest.java @@ -24,6 +24,7 @@ import com.google.common.collect.ImmutableList; import com.google.inject.Binder; import com.google.inject.Injector; +import com.google.inject.ProvisionException; import io.druid.guice.GuiceInjectors; import io.druid.guice.JsonConfigProvider; import io.druid.guice.JsonConfigurator; @@ -105,7 +106,7 @@ public void testInjection2() Assert.assertEquals(false, config.isUseCache()); } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testValidationError() { properties.put(propertyPrefix + ".numBackgroundThreads", "-1"); @@ -116,7 +117,7 @@ public void testValidationError() } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testValidationInsaneError() { properties.put(propertyPrefix + ".numBackgroundThreads", "BABBA YAGA"); @@ -125,7 +126,7 @@ public void testValidationInsaneError() throw new IllegalStateException("Should have already failed"); } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testTRUE() { properties.put(propertyPrefix + ".populateCache", "TRUE"); @@ -134,7 +135,7 @@ public void testTRUE() throw new IllegalStateException("Should have already failed"); } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testFALSE() { properties.put(propertyPrefix + ".populateCache", "FALSE"); @@ -144,7 +145,7 @@ public void testFALSE() } - @Test(expected = com.google.inject.ProvisionException.class) + @Test(expected = ProvisionException.class) public void testFaLse() { properties.put(propertyPrefix + ".populateCache", "FaLse"); diff --git a/server/src/test/java/io/druid/client/selector/TierSelectorStrategyTest.java b/server/src/test/java/io/druid/client/selector/TierSelectorStrategyTest.java index 6787b79c3072..0fb821ca0e14 100644 --- a/server/src/test/java/io/druid/client/selector/TierSelectorStrategyTest.java +++ b/server/src/test/java/io/druid/client/selector/TierSelectorStrategyTest.java @@ -20,6 +20,7 @@ package io.druid.client.selector; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import io.druid.client.DirectDruidClient; import io.druid.client.DruidServer; import io.druid.server.coordination.DruidServerMetadata; @@ -119,7 +120,7 @@ private void testTierSelectorStrategy( "test", new Interval("2013-01-01/2013-01-02"), new DateTime("2013-01-01").toString(), - com.google.common.collect.Maps.newHashMap(), + Maps.newHashMap(), Lists.newArrayList(), Lists.newArrayList(), NoneShardSpec.instance(), diff --git a/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java b/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java index 4cb6899c7a17..9acd78599bdb 100644 --- a/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java +++ b/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java @@ -23,6 +23,7 @@ import com.google.common.collect.Maps; import com.google.common.primitives.Ints; import io.druid.concurrent.Execs; +import io.druid.curator.CuratorTestBase; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.api.CuratorEvent; import org.apache.curator.framework.api.CuratorEventType; @@ -40,7 +41,7 @@ /** */ -public class CuratorInventoryManagerTest extends io.druid.curator.CuratorTestBase +public class CuratorInventoryManagerTest extends CuratorTestBase { private ExecutorService exec; diff --git a/server/src/test/java/io/druid/server/AsyncQueryForwardingServletTest.java b/server/src/test/java/io/druid/server/AsyncQueryForwardingServletTest.java index 409652038386..60b5ffd28b82 100644 --- a/server/src/test/java/io/druid/server/AsyncQueryForwardingServletTest.java +++ b/server/src/test/java/io/druid/server/AsyncQueryForwardingServletTest.java @@ -52,6 +52,7 @@ import io.druid.server.log.RequestLogger; import io.druid.server.metrics.NoopServiceEmitter; import io.druid.server.router.QueryHostFinder; +import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.HandlerList; @@ -225,7 +226,7 @@ public Collection getAllHosts() jsonMapper, injector.getInstance(Key.get(ObjectMapper.class, Smile.class)), hostFinder, - injector.getProvider(org.eclipse.jetty.client.HttpClient.class), + injector.getProvider(HttpClient.class), injector.getInstance(DruidHttpClientConfig.class), new NoopServiceEmitter(), new RequestLogger() diff --git a/server/src/test/java/io/druid/server/QueryResourceTest.java b/server/src/test/java/io/druid/server/QueryResourceTest.java index 3a4573f7cc97..f3d6a6c10e5c 100644 --- a/server/src/test/java/io/druid/server/QueryResourceTest.java +++ b/server/src/test/java/io/druid/server/QueryResourceTest.java @@ -24,6 +24,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; +import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.service.ServiceEmitter; import io.druid.concurrent.Execs; import io.druid.jackson.DefaultObjectMapper; @@ -120,7 +121,7 @@ public QueryRunner getQueryRunnerForSegments( @BeforeClass public static void staticSetup() { - com.metamx.emitter.EmittingLogger.registerEmitter(noopServiceEmitter); + EmittingLogger.registerEmitter(noopServiceEmitter); } @Before diff --git a/server/src/test/java/io/druid/server/log/LoggingRequestLoggerTest.java b/server/src/test/java/io/druid/server/log/LoggingRequestLoggerTest.java index 18e330fcb02c..aa8f8a51cac1 100644 --- a/server/src/test/java/io/druid/server/log/LoggingRequestLoggerTest.java +++ b/server/src/test/java/io/druid/server/log/LoggingRequestLoggerTest.java @@ -37,6 +37,7 @@ import io.druid.server.RequestLogLine; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.core.Appender; +import org.apache.logging.log4j.core.Logger; import org.apache.logging.log4j.core.appender.OutputStreamAppender; import org.apache.logging.log4j.core.layout.JsonLayout; import org.joda.time.DateTime; @@ -98,7 +99,7 @@ public static void setUpStatic() throws Exception .setTarget(baos) .setLayout(JsonLayout.createLayout(false, true, false, true, true, Charsets.UTF_8)) .build(); - final org.apache.logging.log4j.core.Logger logger = (org.apache.logging.log4j.core.Logger) + final Logger logger = (Logger) LogManager.getLogger(LoggingRequestLogger.class); appender.start(); logger.addAppender(appender); @@ -113,7 +114,7 @@ public void tearDown() @AfterClass public static void tearDownStatic() { - final org.apache.logging.log4j.core.Logger logger = (org.apache.logging.log4j.core.Logger) LogManager.getLogger( + final Logger logger = (Logger) LogManager.getLogger( LoggingRequestLogger.class); logger.removeAppender(appender); appender.stop(); diff --git a/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerTest.java b/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerTest.java index e2fad952dcc1..7194bce4c69b 100644 --- a/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerTest.java +++ b/server/src/test/java/io/druid/server/lookup/cache/LookupCoordinatorManagerTest.java @@ -26,6 +26,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.net.HostAndPort; import com.google.common.util.concurrent.SettableFuture; +import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.core.Event; import com.metamx.emitter.core.LoggingEmitter; import com.metamx.emitter.service.ServiceEmitter; @@ -129,7 +130,7 @@ public void emit(Event event) super.emit(event); } }; - com.metamx.emitter.EmittingLogger.registerEmitter(SERVICE_EMITTER); + EmittingLogger.registerEmitter(SERVICE_EMITTER); } @Before diff --git a/sql/src/main/java/io/druid/sql/calcite/rel/QueryMaker.java b/sql/src/main/java/io/druid/sql/calcite/rel/QueryMaker.java index 4e6f091dd2c9..c7a59b12513f 100644 --- a/sql/src/main/java/io/druid/sql/calcite/rel/QueryMaker.java +++ b/sql/src/main/java/io/druid/sql/calcite/rel/QueryMaker.java @@ -27,6 +27,7 @@ import com.google.common.primitives.Ints; import io.druid.client.DirectDruidClient; import io.druid.common.guava.GuavaUtils; +import io.druid.data.input.Row; import io.druid.java.util.common.ISE; import io.druid.java.util.common.guava.Sequence; import io.druid.java.util.common.guava.Sequences; @@ -355,10 +356,10 @@ private Sequence executeGroupBy( walker, DirectDruidClient.makeResponseContextForQuery(query, plannerContext.getQueryStartTimeMillis()) ), - new Function() + new Function() { @Override - public Object[] apply(final io.druid.data.input.Row row) + public Object[] apply(final Row row) { final Object[] retVal = new Object[fieldList.size()]; for (RelDataTypeField field : fieldList) {