Use only com.google.errorprone.annotations.concurrent.GuardedBy, not javax.annotations.concurrent.GuardedBy (#7889)

This commit is contained in:
SandishKumarHN 2019-06-17 06:58:51 -07:00 committed by Roman Leventov
parent 4bceab0d7b
commit 01881e3a98
12 changed files with 19 additions and 12 deletions

View File

@ -42,4 +42,7 @@ com.ibm.icu.text.SimpleDateFormat#<init>(java.lang.String)
@defaultMessage For performance reasons, use the utf8Base64 / encodeBase64 / encodeBase64String / decodeBase64 / decodeBase64String methods in StringUtils
org.apache.commons.codec.binary.Base64
com.google.common.io.BaseEncoding.base64
com.google.common.io.BaseEncoding.base64
@defaultMessage Use com.google.errorprone.annotations.concurrent.GuardedBy
javax.annotations.concurrent.GuardedBy

View File

@ -284,6 +284,10 @@
<artifactId>jetty-servlet</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -19,12 +19,12 @@
package org.apache.druid.common.config;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import org.apache.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;
import javax.annotation.concurrent.GuardedBy;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.TimeUnit;

View File

@ -19,10 +19,9 @@
package org.apache.druid.java.util.common.concurrent;
import com.google.common.util.concurrent.AbstractListeningExecutorService;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import javax.annotation.concurrent.GuardedBy;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.RejectedExecutionException;

View File

@ -21,6 +21,7 @@ package org.apache.druid.java.util.emitter.core;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableSet;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.java.util.common.lifecycle.Lifecycle;
import org.apache.druid.java.util.common.lifecycle.LifecycleStart;
@ -28,7 +29,6 @@ import org.apache.druid.java.util.common.lifecycle.LifecycleStop;
import org.apache.druid.java.util.common.logger.Logger;
import org.asynchttpclient.AsyncHttpClient;
import javax.annotation.concurrent.GuardedBy;
import java.io.Closeable;
import java.io.Flushable;
import java.net.URI;

View File

@ -19,12 +19,13 @@
package org.apache.druid.query.aggregation.tdigestsketch;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import com.tdunning.math.stats.MergingDigest;
import org.apache.druid.query.aggregation.Aggregator;
import org.apache.druid.segment.ColumnValueSelector;
import javax.annotation.Nullable;
import javax.annotation.concurrent.GuardedBy;
/**
* Aggregator to build T-Digest sketches on numeric values.

View File

@ -19,11 +19,11 @@
package org.apache.druid.query.aggregation.tdigestsketch;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import com.tdunning.math.stats.MergingDigest;
import org.apache.druid.query.aggregation.Aggregator;
import org.apache.druid.segment.ColumnValueSelector;
import javax.annotation.concurrent.GuardedBy;
/**
* Aggregator that merges T-Digest based sketches generated from {@link TDigestBuildSketchAggregator}

View File

@ -39,6 +39,7 @@ import com.google.common.io.Files;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import com.google.inject.Inject;
import org.apache.commons.io.FileUtils;
import org.apache.druid.guice.annotations.Self;
@ -69,7 +70,6 @@ import org.joda.time.DateTime;
import org.joda.time.Interval;
import javax.annotation.Nullable;
import javax.annotation.concurrent.GuardedBy;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;

View File

@ -29,6 +29,7 @@ import com.google.common.collect.Iterators;
import com.google.common.collect.Maps;
import com.google.common.primitives.Ints;
import com.google.common.primitives.Longs;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import org.apache.druid.collections.NonBlockingPool;
import org.apache.druid.common.config.NullHandling;
import org.apache.druid.common.guava.GuavaUtils;
@ -75,7 +76,6 @@ import org.joda.time.DateTime;
import org.joda.time.Interval;
import javax.annotation.Nullable;
import javax.annotation.concurrent.GuardedBy;
import java.io.Closeable;
import java.nio.ByteBuffer;
import java.util.ArrayList;

View File

@ -22,6 +22,7 @@ package org.apache.druid.curator.discovery;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import com.google.inject.Inject;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.cache.PathChildrenCache;
@ -42,7 +43,6 @@ import org.apache.druid.java.util.common.lifecycle.LifecycleStop;
import org.apache.druid.java.util.common.logger.Logger;
import org.apache.druid.server.initialization.ZkPathsConfig;
import javax.annotation.concurrent.GuardedBy;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

View File

@ -25,11 +25,11 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.common.logger.Logger;
import org.apache.druid.sql.SqlLifecycleFactory;
import javax.annotation.concurrent.GuardedBy;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

View File

@ -21,6 +21,7 @@ package org.apache.druid.sql.avatica;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import org.apache.calcite.avatica.ColumnMetaData;
import org.apache.calcite.avatica.Meta;
import org.apache.calcite.rel.type.RelDataType;
@ -36,7 +37,6 @@ import org.apache.druid.server.security.ForbiddenException;
import org.apache.druid.sql.SqlLifecycle;
import org.apache.druid.sql.calcite.rel.QueryMaker;
import javax.annotation.concurrent.GuardedBy;
import java.io.Closeable;
import java.sql.DatabaseMetaData;
import java.util.ArrayList;