mirror of https://github.com/apache/druid.git
Add PMD and prohibit unnecessary fully qualified class names in code (#4350)
* Add PMD and prohibit unnecessary fully qualified class names in code * Extra fixes * Remove extra unnecessary fully-qualified names * Remove qualifiers * Remove qualifier
This commit is contained in:
parent
b7203510b8
commit
60cdf94677
|
@ -104,6 +104,12 @@
|
|||
<inspection_tool class="SyntaxError" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="TextLabelInSwitchStatement" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
<inspection_tool class="ThrowableNotThrown" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
<inspection_tool class="UnnecessaryFullyQualifiedName" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<scope name="NonGeneratedFiles" level="ERROR" enabled="true">
|
||||
<option name="m_ignoreJavadoc" value="true" />
|
||||
</scope>
|
||||
<option name="m_ignoreJavadoc" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="UseOfPropertiesAsHashtable" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="VariableNotUsedInsideIf" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="XmlHighlighting" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<component name="DependencyValidationManager">
|
||||
<scope name="NonGeneratedFiles" pattern="(src:*..*||test:*..*)&&!test[druid-protobuf-extensions]:io.druid.data.input.protobuf.ProtoTestEventWrapper" />
|
||||
</component>
|
|
@ -48,7 +48,7 @@ import java.util.Properties;
|
|||
* <h3>Implementation</h3>
|
||||
* <br/>
|
||||
* The state of {@code <T>} 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)}.
|
||||
* <br/>
|
||||
*
|
||||
* An example might be if DruidServerConfig.class were
|
||||
|
|
|
@ -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 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.
|
||||
*
|
||||
|
@ -92,8 +92,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.
|
||||
*
|
||||
|
@ -107,15 +107,15 @@ public class LifecycleModule implements Module
|
|||
}
|
||||
|
||||
/**
|
||||
* Registers a key to instantiate eagerly. {@link com.google.inject.Key}s mentioned here will be pulled out of
|
||||
* Registers a key to instantiate eagerly. {@link Key}s mentioned here will be pulled out of
|
||||
* the injector with an injector.getInstance() call when the lifecycle is created.
|
||||
*
|
||||
* Eagerly loaded classes will *not* be automatically added to the Lifecycle unless they are bound to the proper
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
|
|
|
@ -29,7 +29,7 @@ import java.lang.annotation.Target;
|
|||
/**
|
||||
* Marks the object to be managed by {@link io.druid.java.util.common.lifecycle.Lifecycle}
|
||||
*
|
||||
* This Scope gets defined by {@link io.druid.guice.LifecycleModule}
|
||||
* This Scope gets defined by {@link LifecycleModule}
|
||||
*/
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
|
|
@ -29,7 +29,7 @@ import java.lang.annotation.Target;
|
|||
/**
|
||||
* Marks the object to be managed by {@link io.druid.java.util.common.lifecycle.Lifecycle} and set to be on Stage.LAST
|
||||
*
|
||||
* This Scope gets defined by {@link io.druid.guice.LifecycleModule}
|
||||
* This Scope gets defined by {@link LifecycleModule}
|
||||
*/
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
|
|
@ -69,7 +69,7 @@ public class PolyBind
|
|||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
|
|
|
@ -67,8 +67,7 @@ public class DataSegmentUtils
|
|||
*
|
||||
* @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)
|
||||
{
|
||||
|
|
|
@ -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 class ConfigDrivenAwsCredentialsConfigProvider implements AWSCredentialsP
|
|||
}
|
||||
|
||||
@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();
|
||||
|
|
|
@ -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 @@ public class LazyFileSessionCredentialsProvider implements AWSCredentialsProvide
|
|||
}
|
||||
|
||||
@Override
|
||||
public com.amazonaws.auth.AWSCredentials getCredentials()
|
||||
public AWSCredentials getCredentials()
|
||||
{
|
||||
return getUnderlyingProvider().getCredentials();
|
||||
}
|
||||
|
|
|
@ -53,13 +53,13 @@ public abstract class GutmanSplitStrategy implements SplitStrategy
|
|||
*
|
||||
* 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.
|
||||
|
|
|
@ -189,7 +189,7 @@ public class TestIntegerSet
|
|||
IntegerSet integerSet = IntegerSet.wrap(wrappedBitmap);
|
||||
integerSet.add(Integer.MAX_VALUE + 1);
|
||||
}
|
||||
catch (java.lang.IllegalArgumentException ex) {
|
||||
catch (IllegalArgumentException ex) {
|
||||
e = ex;
|
||||
}
|
||||
Assert.assertNotNull(e);
|
||||
|
|
|
@ -21,6 +21,7 @@ package io.druid.common.config;
|
|||
|
||||
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.Queue;
|
|||
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;
|
||||
|
||||
|
|
|
@ -49,8 +49,7 @@ public class VMUtils
|
|||
*
|
||||
* @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
|
||||
* @throws UnsupportedOperationException if the Java virtual machine does not support CPU time measurement for
|
||||
* the current thread.
|
||||
*/
|
||||
public static long getCurrentThreadCpuTime()
|
||||
|
|
|
@ -25,6 +25,7 @@ import io.druid.java.util.common.StringUtils;
|
|||
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 @@ import java.util.SortedSet;
|
|||
* @author Alessandro Colantonio
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ConciseSet extends AbstractIntSet implements java.io.Serializable
|
||||
public class ConciseSet extends AbstractIntSet implements Serializable
|
||||
{
|
||||
/**
|
||||
* generated serial ID
|
||||
|
|
|
@ -21,6 +21,7 @@ import com.google.common.collect.Iterators;
|
|||
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 class ImmutableConciseSet
|
|||
return new WordIterator();
|
||||
}
|
||||
|
||||
public class WordIterator implements org.roaringbitmap.IntIterator, Cloneable
|
||||
public class WordIterator implements IntIterator, Cloneable
|
||||
{
|
||||
private int startIndex;
|
||||
private int wordsWalked;
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.metamx.emitter.service.ServiceMetricEvent;
|
|||
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}.
|
||||
* <p>
|
||||
* All the dimensions will be retained and lexicographically order using dimensions name.
|
||||
* <p>
|
||||
|
|
|
@ -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 class CassandraDruidModule implements DruidModule
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<? extends com.fasterxml.jackson.databind.Module> getJacksonModules()
|
||||
public List<? extends Module> getJacksonModules()
|
||||
{
|
||||
return ImmutableList.of(
|
||||
new com.fasterxml.jackson.databind.Module()
|
||||
new Module()
|
||||
{
|
||||
@Override
|
||||
public String getModuleName()
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.metamx.emitter.service.ServiceMetricEvent;
|
|||
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}.
|
||||
* <p>
|
||||
* All the dimensions will be retained and lexicographically order using dimensions name.
|
||||
* <p>
|
||||
|
|
|
@ -59,6 +59,7 @@ import org.apache.hadoop.mapreduce.JobContext;
|
|||
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 @@ public class OrcIndexGeneratorJobTest
|
|||
.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)
|
||||
|
|
|
@ -126,7 +126,7 @@ public class SQLServerConnector extends SQLMetadataConnector
|
|||
* <p>
|
||||
*
|
||||
* @see <a href="https://github.com/spring-projects/spring-framework/blob/v4.3.2.RELEASE/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLStateSQLExceptionTranslator.java">Spring Framework SQLStateSQLExceptionTranslator</a>
|
||||
* @see java.sql.SQLException#getSQLState()
|
||||
* @see SQLException#getSQLState()
|
||||
*/
|
||||
private final Set<String> TRANSIENT_SQL_CLASS_CODES = new HashSet<>(Arrays.asList(
|
||||
"08", "53", "54", "57", "58", // Resource Failures
|
||||
|
@ -265,7 +265,7 @@ public class SQLServerConnector extends SQLMetadataConnector
|
|||
*
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @see java.sql.SQLException#getSQLState()
|
||||
* @see SQLException#getSQLState()
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -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 class SQLServerMetadataStorageModule extends SQLMetadataStorageDruidModul
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<? extends com.fasterxml.jackson.databind.Module> getJacksonModules()
|
||||
public List<? extends Module> getJacksonModules()
|
||||
{
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
|
|
@ -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 class AvroStreamInputRowParserTest
|
|||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ public class CaffeineCache implements io.druid.client.cache.Cache
|
|||
@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())
|
||||
|
|
|
@ -43,6 +43,7 @@ import kafka.consumer.ConsumerConfig;
|
|||
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 class KafkaLookupExtractorFactory implements LookupExtractorFactory
|
|||
// Overridden in tests
|
||||
ConsumerConnector buildConnector(Properties properties)
|
||||
{
|
||||
return new kafka.javaapi.consumer.ZookeeperConsumerConnector(
|
||||
return new ZookeeperConsumerConnector(
|
||||
new ConsumerConfig(properties)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ import kafka.server.KafkaServer;
|
|||
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 class TestKafkaExtractionCluster
|
|||
try {
|
||||
zkClient.deleteRecursive(zkKafkaPath);
|
||||
}
|
||||
catch (org.I0Itec.zkclient.exception.ZkException ex) {
|
||||
catch (ZkException ex) {
|
||||
log.warn(ex, "error deleting %s zk node", zkKafkaPath);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -453,8 +453,8 @@ public final class CacheScheduler
|
|||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
@ -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 class MySQLMetadataStorageModule extends SQLMetadataStorageDruidModule im
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<? extends com.fasterxml.jackson.databind.Module> getJacksonModules()
|
||||
public List<? extends Module> getJacksonModules()
|
||||
{
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
|
|
@ -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 class PostgreSQLMetadataStorageModule extends SQLMetadataStorageDruidModu
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<? extends com.fasterxml.jackson.databind.Module> getJacksonModules()
|
||||
public List<? extends Module> getJacksonModules()
|
||||
{
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
|
|
@ -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 class S3StorageDruidModule implements DruidModule
|
|||
@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(
|
||||
|
|
|
@ -357,8 +357,8 @@ public class DatasourceInputFormatTest
|
|||
@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 class DatasourceInputFormatTest
|
|||
@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 class DatasourceInputFormatTest
|
|||
@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(
|
||||
|
|
|
@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||
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 class SegmentInsertAction implements TaskAction<Set<DataSegment>>
|
|||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ public class 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 class TaskLockbox
|
|||
* @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
|
||||
{
|
||||
|
|
|
@ -305,7 +305,7 @@ public class TaskQueue
|
|||
*
|
||||
* @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
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
|||
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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<ImmutableWorkerInfo> findWorkerForTask(
|
||||
final WorkerTaskRunnerConfig config,
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.google.inject.Binder;
|
|||
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 class ForkingTaskRunnerConfigTest
|
|||
);
|
||||
}
|
||||
|
||||
@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\"}");
|
||||
|
|
|
@ -283,7 +283,7 @@ public class TestNG
|
|||
*
|
||||
* @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 class TestNG
|
|||
*
|
||||
* @param suites
|
||||
*
|
||||
* @see org.testng.xml.XmlSuite
|
||||
* @see XmlSuite
|
||||
*/
|
||||
public void setXmlSuites(List<XmlSuite> suites)
|
||||
{
|
||||
|
@ -2116,7 +2116,7 @@ public class TestNG
|
|||
}
|
||||
|
||||
/**
|
||||
* @see org.testng.IConfigurationListener#onConfigurationFailure(org.testng.ITestResult)
|
||||
* @see IConfigurationListener#onConfigurationFailure(ITestResult)
|
||||
*/
|
||||
@Override
|
||||
public void onConfigurationFailure(ITestResult itr)
|
||||
|
@ -2125,7 +2125,7 @@ public class TestNG
|
|||
}
|
||||
|
||||
/**
|
||||
* @see org.testng.IConfigurationListener#onConfigurationSkip(org.testng.ITestResult)
|
||||
* @see IConfigurationListener#onConfigurationSkip(ITestResult)
|
||||
*/
|
||||
@Override
|
||||
public void onConfigurationSkip(ITestResult itr)
|
||||
|
@ -2134,7 +2134,7 @@ public class TestNG
|
|||
}
|
||||
|
||||
/**
|
||||
* @see org.testng.IConfigurationListener#onConfigurationSuccess(org.testng.ITestResult)
|
||||
* @see IConfigurationListener#onConfigurationSuccess(ITestResult)
|
||||
*/
|
||||
@Override
|
||||
public void onConfigurationSuccess(ITestResult itr)
|
||||
|
|
|
@ -489,7 +489,7 @@ public class CompressionUtils
|
|||
*
|
||||
* @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)
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ public class FileUtils
|
|||
* @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 class FileUtils
|
|||
|
||||
/**
|
||||
* 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)}.
|
||||
*
|
||||
* <p>Files are mapped from offset 0 to its length.
|
||||
*
|
||||
|
|
|
@ -308,7 +308,7 @@ public class CompressionUtilsTest
|
|||
}
|
||||
|
||||
// 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
|
||||
{
|
||||
|
|
|
@ -23,6 +23,7 @@ import junit.framework.Assert;
|
|||
import org.junit.Test;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.BufferUnderflowException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/**
|
||||
|
@ -70,7 +71,7 @@ public class StringUtilsTest
|
|||
}
|
||||
|
||||
|
||||
@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 class StringUtilsTest
|
|||
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);
|
||||
|
|
|
@ -23,6 +23,7 @@ import com.google.common.collect.ImmutableMap;
|
|||
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 class JavaScriptParserTest
|
|||
);
|
||||
}
|
||||
|
||||
@Test(expected = org.mozilla.javascript.EvaluatorException.class)
|
||||
@Test(expected = EvaluatorException.class)
|
||||
public void testFailure()
|
||||
{
|
||||
final String function = "i am bad javascript";
|
||||
|
|
23
pom.xml
23
pom.xml
|
@ -890,6 +890,29 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<version>3.8</version>
|
||||
<configuration>
|
||||
<printFailingErrors>true</printFailingErrors>
|
||||
<rulesets>
|
||||
<ruleset>/rulesets/java/imports.xml</ruleset>
|
||||
</rulesets>
|
||||
<excludeRoots>
|
||||
<excludeRoot>target/generated-sources/</excludeRoot>
|
||||
</excludeRoots>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>validate</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>animal-sniffer-maven-plugin</artifactId>
|
||||
|
|
|
@ -24,9 +24,9 @@ import io.druid.collections.bitmap.ImmutableBitmap;
|
|||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
|
|
@ -325,7 +325,7 @@ public class Druids
|
|||
* .build();
|
||||
* </code></pre>
|
||||
*
|
||||
* @see io.druid.query.timeseries.TimeseriesQuery
|
||||
* @see TimeseriesQuery
|
||||
*/
|
||||
public static class TimeseriesQueryBuilder
|
||||
{
|
||||
|
@ -544,7 +544,7 @@ public class Druids
|
|||
* .build();
|
||||
* </code></pre>
|
||||
*
|
||||
* @see io.druid.query.search.search.SearchQuery
|
||||
* @see SearchQuery
|
||||
*/
|
||||
public static class SearchQueryBuilder
|
||||
{
|
||||
|
@ -766,7 +766,7 @@ public class Druids
|
|||
* .build();
|
||||
* </code></pre>
|
||||
*
|
||||
* @see io.druid.query.timeboundary.TimeBoundaryQuery
|
||||
* @see TimeBoundaryQuery
|
||||
*/
|
||||
public static class TimeBoundaryQueryBuilder
|
||||
{
|
||||
|
@ -951,7 +951,7 @@ public class Druids
|
|||
* .build();
|
||||
* </code></pre>
|
||||
*
|
||||
* @see io.druid.query.metadata.metadata.SegmentMetadataQuery
|
||||
* @see SegmentMetadataQuery
|
||||
*/
|
||||
public static class SegmentMetadataQueryBuilder
|
||||
{
|
||||
|
@ -1091,7 +1091,7 @@ public class Druids
|
|||
* .build();
|
||||
* </code></pre>
|
||||
*
|
||||
* @see io.druid.query.select.SelectQuery
|
||||
* @see SelectQuery
|
||||
*/
|
||||
public static class SelectQueryBuilder
|
||||
{
|
||||
|
@ -1281,7 +1281,7 @@ public class Druids
|
|||
* .build();
|
||||
* </code></pre>
|
||||
*
|
||||
* @see io.druid.query.datasourcemetadata.DataSourceMetadataQuery
|
||||
* @see DataSourceMetadataQuery
|
||||
*/
|
||||
public static class DataSourceMetadataQueryBuilder
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import io.druid.query.extraction.ExtractionFn;
|
|||
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
|
||||
|
|
|
@ -61,7 +61,7 @@ import java.util.Map;
|
|||
* .build();
|
||||
* </code></pre>
|
||||
*
|
||||
* @see io.druid.query.topn.TopNQuery
|
||||
* @see TopNQuery
|
||||
*/
|
||||
public class TopNQueryBuilder
|
||||
{
|
||||
|
|
|
@ -23,8 +23,6 @@ import io.druid.query.QueryMetrics;
|
|||
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<TopNQuery>
|
|||
/**
|
||||
* 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);
|
||||
|
|
|
@ -167,7 +167,7 @@ public interface IndexMerger
|
|||
*
|
||||
* @return the index output directory
|
||||
*
|
||||
* @throws java.io.IOException if an IO error occurs persisting the index
|
||||
* @throws IOException if an IO error occurs persisting the index
|
||||
*/
|
||||
File persist(IncrementalIndex index, Interval dataInterval, File outDir, IndexSpec indexSpec) throws IOException;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public interface QueryableIndex extends ColumnSelector, Closeable
|
|||
|
||||
/**
|
||||
* The close method shouldn't actually be here as this is nasty. We will adjust it in the future.
|
||||
* @throws java.io.IOException if an exception was thrown closing the index
|
||||
* @throws IOException if an exception was thrown closing the index
|
||||
*/
|
||||
//@Deprecated // This is still required for SimpleQueryableIndex. It should not go away unitl SimpleQueryableIndex is fixed
|
||||
@Override
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.nio.ByteOrder;
|
|||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Compression of metrics is done by using a combination of {@link io.druid.segment.data.CompressedObjectStrategy.CompressionStrategy}
|
||||
* Compression of metrics is done by using a combination of {@link CompressedObjectStrategy.CompressionStrategy}
|
||||
* and Encoding(such as {@link LongEncodingStrategy} for type Long). CompressionStrategy is unaware of the data type
|
||||
* and is based on byte operations. It must compress and decompress in block of bytes. Encoding refers to compression
|
||||
* method relies on data format, so a different set of Encodings exist for each data type.
|
||||
|
|
|
@ -22,6 +22,7 @@ package io.druid.guice;
|
|||
import com.fasterxml.jackson.annotation.JacksonInject;
|
||||
import com.google.inject.Binder;
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Injector;
|
||||
import com.google.inject.Module;
|
||||
import com.google.inject.Provider;
|
||||
|
@ -68,7 +69,7 @@ public class GuiceInjectorsTest
|
|||
private Emitter emitter;
|
||||
private Injector injector;
|
||||
|
||||
@com.google.inject.Inject
|
||||
@Inject
|
||||
public void configure(Injector injector) {
|
||||
this.injector = injector;
|
||||
emitter = injector.getInstance(Emitter.class);
|
||||
|
|
|
@ -25,6 +25,8 @@ import io.druid.jackson.DefaultObjectMapper;
|
|||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -85,7 +87,7 @@ public class StringFormatExtractionFnTest
|
|||
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);
|
||||
|
|
|
@ -48,6 +48,7 @@ import org.joda.time.Interval;
|
|||
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 class SpecificSegmentQueryRunnerTest
|
|||
}
|
||||
|
||||
private void validate(ObjectMapper mapper, SegmentDescriptor descriptor, Map<String, Object> responseContext)
|
||||
throws java.io.IOException
|
||||
throws IOException
|
||||
{
|
||||
Object missingSegments = responseContext.get(Result.MISSING_SEGMENTS_KEY);
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ public class MergeIntIteratorTest
|
|||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
@ -288,7 +288,7 @@ public class HttpServerInventoryView implements ServerInventoryView, FilteredSer
|
|||
{
|
||||
synchronized (servers) {
|
||||
return Iterables.transform(
|
||||
servers.values(), new com.google.common.base.Function<DruidServerHolder, DruidServer>()
|
||||
servers.values(), new Function<DruidServerHolder, DruidServer>()
|
||||
{
|
||||
@Override
|
||||
public DruidServer apply(DruidServerHolder input)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 @@ public class LocalDataStorageDruidModule implements DruidModule
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<? extends com.fasterxml.jackson.databind.Module> getJacksonModules()
|
||||
public List<? extends Module> getJacksonModules()
|
||||
{
|
||||
return ImmutableList.of(
|
||||
new com.fasterxml.jackson.databind.Module()
|
||||
new Module()
|
||||
{
|
||||
@Override
|
||||
public String getModuleName()
|
||||
|
|
|
@ -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 class ServerModule implements DruidModule
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<? extends com.fasterxml.jackson.databind.Module> getJacksonModules()
|
||||
public List<? extends Module> getJacksonModules()
|
||||
{
|
||||
return Collections.singletonList(
|
||||
new SimpleModule()
|
||||
|
|
|
@ -122,8 +122,8 @@ public class Initialization
|
|||
|
||||
/**
|
||||
* 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)
|
||||
|
|
|
@ -68,8 +68,8 @@ import java.util.concurrent.TimeUnit;
|
|||
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<MapInputRowParser>
|
||||
{
|
||||
|
|
|
@ -109,7 +109,7 @@ public class ListenerDiscoverer
|
|||
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();
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import com.fasterxml.jackson.databind.module.SimpleModule;
|
|||
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 class CacheConfigTest
|
|||
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 class CacheConfigTest
|
|||
}
|
||||
|
||||
|
||||
@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 class CacheConfigTest
|
|||
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 class CacheConfigTest
|
|||
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 class CacheConfigTest
|
|||
}
|
||||
|
||||
|
||||
@Test(expected = com.google.inject.ProvisionException.class)
|
||||
@Test(expected = ProvisionException.class)
|
||||
public void testFaLse()
|
||||
{
|
||||
properties.put(propertyPrefix + ".populateCache", "FaLse");
|
||||
|
|
|
@ -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 @@ public class TierSelectorStrategyTest
|
|||
"test",
|
||||
new Interval("2013-01-01/2013-01-02"),
|
||||
new DateTime("2013-01-01").toString(),
|
||||
com.google.common.collect.Maps.<String, Object>newHashMap(),
|
||||
Maps.<String, Object>newHashMap(),
|
||||
Lists.<String>newArrayList(),
|
||||
Lists.<String>newArrayList(),
|
||||
NoneShardSpec.instance(),
|
||||
|
|
|
@ -23,6 +23,7 @@ import com.google.common.collect.Iterables;
|
|||
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 @@ import java.util.concurrent.ExecutorService;
|
|||
|
||||
/**
|
||||
*/
|
||||
public class CuratorInventoryManagerTest extends io.druid.curator.CuratorTestBase
|
||||
public class CuratorInventoryManagerTest extends CuratorTestBase
|
||||
{
|
||||
private ExecutorService exec;
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ import io.druid.server.initialization.jetty.JettyServerInitializer;
|
|||
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 class AsyncQueryForwardingServletTest extends BaseJettyTest
|
|||
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()
|
||||
|
|
|
@ -24,6 +24,7 @@ import com.google.common.base.Throwables;
|
|||
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 class QueryResourceTest
|
|||
@BeforeClass
|
||||
public static void staticSetup()
|
||||
{
|
||||
com.metamx.emitter.EmittingLogger.registerEmitter(noopServiceEmitter);
|
||||
EmittingLogger.registerEmitter(noopServiceEmitter);
|
||||
}
|
||||
|
||||
@Before
|
||||
|
|
|
@ -37,6 +37,7 @@ import io.druid.server.QueryStats;
|
|||
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 class LoggingRequestLoggerTest
|
|||
.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 class LoggingRequestLoggerTest
|
|||
@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();
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.google.common.collect.ImmutableMap;
|
|||
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 class LookupCoordinatorManagerTest
|
|||
super.emit(event);
|
||||
}
|
||||
};
|
||||
com.metamx.emitter.EmittingLogger.registerEmitter(SERVICE_EMITTER);
|
||||
EmittingLogger.registerEmitter(SERVICE_EMITTER);
|
||||
}
|
||||
|
||||
@Before
|
||||
|
|
|
@ -27,6 +27,7 @@ import com.google.common.primitives.Doubles;
|
|||
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 @@ public class QueryMaker
|
|||
walker,
|
||||
DirectDruidClient.makeResponseContextForQuery(query, plannerContext.getQueryStartTimeMillis())
|
||||
),
|
||||
new Function<io.druid.data.input.Row, Object[]>()
|
||||
new Function<Row, Object[]>()
|
||||
{
|
||||
@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) {
|
||||
|
|
Loading…
Reference in New Issue