mirror of https://github.com/apache/druid.git
Migrated commons-lang usages to commons-lang3 (#17156)
This commit is contained in:
parent
661614129e
commit
ab361747a8
|
@ -100,11 +100,6 @@
|
|||
<artifactId>jsr305</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Tests -->
|
||||
<dependency>
|
||||
|
|
|
@ -76,11 +76,6 @@
|
|||
<version>${project.parent.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
|
|
|
@ -33,7 +33,7 @@ import io.fabric8.kubernetes.api.model.VolumeBuilder;
|
|||
import io.fabric8.kubernetes.api.model.VolumeMount;
|
||||
import io.fabric8.kubernetes.api.model.VolumeMountBuilder;
|
||||
import io.fabric8.kubernetes.api.model.batch.v1.Job;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
import org.apache.druid.indexing.common.config.TaskConfig;
|
||||
import org.apache.druid.indexing.common.task.Task;
|
||||
import org.apache.druid.k8s.overlord.KubernetesTaskRunnerConfig;
|
||||
|
|
|
@ -40,8 +40,8 @@ import io.fabric8.kubernetes.api.model.batch.v1.JobBuilder;
|
|||
import io.fabric8.kubernetes.api.model.batch.v1.JobList;
|
||||
import io.fabric8.kubernetes.client.KubernetesClient;
|
||||
import io.fabric8.kubernetes.client.server.mock.EnableKubernetesMockClient;
|
||||
import org.apache.commons.lang.RandomStringUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.error.DruidException;
|
||||
import org.apache.druid.indexing.common.TestUtils;
|
||||
import org.apache.druid.indexing.common.config.TaskConfig;
|
||||
|
|
|
@ -28,7 +28,7 @@ import io.fabric8.kubernetes.api.model.PodTemplateBuilder;
|
|||
import io.fabric8.kubernetes.api.model.VolumeBuilder;
|
||||
import io.fabric8.kubernetes.api.model.batch.v1.Job;
|
||||
import io.fabric8.kubernetes.api.model.batch.v1.JobBuilder;
|
||||
import org.apache.commons.lang.RandomStringUtils;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.apache.druid.error.DruidException;
|
||||
import org.apache.druid.indexing.common.TestUtils;
|
||||
import org.apache.druid.indexing.common.config.TaskConfig;
|
||||
|
|
|
@ -77,8 +77,8 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package org.apache.druid.client.cache;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.java.util.common.IAE;
|
||||
import redis.clients.jedis.ConnectionPoolConfig;
|
||||
import redis.clients.jedis.HostAndPort;
|
||||
|
|
|
@ -217,8 +217,8 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.druid.data.input.avro;
|
|||
import org.apache.avro.Schema;
|
||||
import org.apache.avro.generic.GenericRecord;
|
||||
import org.apache.avro.mapreduce.AvroJob;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.java.util.common.logger.Logger;
|
||||
import org.apache.hadoop.fs.FSDataInputStream;
|
||||
import org.apache.hadoop.fs.FileSystem;
|
||||
|
|
|
@ -131,11 +131,6 @@
|
|||
<artifactId>jsr305</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
|
|
|
@ -73,7 +73,7 @@ public class AzureDataSegmentPusher implements DataSegmentPusher
|
|||
public String getPathForHadoop()
|
||||
{
|
||||
String prefix = segmentConfig.getPrefix();
|
||||
boolean prefixIsNullOrEmpty = org.apache.commons.lang.StringUtils.isEmpty(prefix);
|
||||
boolean prefixIsNullOrEmpty = org.apache.commons.lang3.StringUtils.isEmpty(prefix);
|
||||
String hadoopPath = StringUtils.format(
|
||||
"%s://%s@%s.%s/%s",
|
||||
AzureUtils.AZURE_STORAGE_HADOOP_PROTOCOL,
|
||||
|
@ -129,7 +129,7 @@ public class AzureDataSegmentPusher implements DataSegmentPusher
|
|||
public DataSegment pushToPath(File indexFilesDir, DataSegment segment, String storageDirSuffix) throws IOException
|
||||
{
|
||||
String prefix = segmentConfig.getPrefix();
|
||||
boolean prefixIsNullOrEmpty = org.apache.commons.lang.StringUtils.isEmpty(prefix);
|
||||
boolean prefixIsNullOrEmpty = org.apache.commons.lang3.StringUtils.isEmpty(prefix);
|
||||
final String azurePath = JOINER.join(
|
||||
prefixIsNullOrEmpty ? null : StringUtils.maybeRemoveTrailingSlash(prefix),
|
||||
storageDirSuffix
|
||||
|
|
|
@ -57,12 +57,6 @@
|
|||
<artifactId>commons-io</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.6</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
|
|
|
@ -94,8 +94,8 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.druid.storage.hdfs;
|
|||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.inject.Inject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.guice.Hdfs;
|
||||
import org.apache.druid.java.util.common.ISE;
|
||||
import org.apache.druid.java.util.emitter.EmittingLogger;
|
||||
|
|
|
@ -196,11 +196,6 @@
|
|||
<artifactId>fastutil-core</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
|
|
|
@ -93,8 +93,8 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -34,7 +34,7 @@ import com.google.common.collect.ImmutableList;
|
|||
import com.google.inject.Binder;
|
||||
import com.google.inject.Provides;
|
||||
import com.google.inject.multibindings.MapBinder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.common.aws.AWSClientConfig;
|
||||
import org.apache.druid.common.aws.AWSEndpointConfig;
|
||||
import org.apache.druid.common.aws.AWSProxyConfig;
|
||||
|
|
|
@ -379,7 +379,7 @@ public class S3Utils
|
|||
{
|
||||
final Protocol protocolFromClientConfig = parseProtocol(clientConfig.getProtocol());
|
||||
final String endpointUrl = endpointConfig.getUrl();
|
||||
if (org.apache.commons.lang.StringUtils.isNotEmpty(endpointUrl)) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(endpointUrl)) {
|
||||
//noinspection ConstantConditions
|
||||
final URI uri = URIs.parse(endpointUrl, protocolFromClientConfig.toString());
|
||||
final Protocol protocol = parseProtocol(uri.getScheme());
|
||||
|
@ -394,16 +394,16 @@ public class S3Utils
|
|||
|
||||
public static ClientConfiguration setProxyConfig(ClientConfiguration conf, AWSProxyConfig proxyConfig)
|
||||
{
|
||||
if (org.apache.commons.lang.StringUtils.isNotEmpty(proxyConfig.getHost())) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(proxyConfig.getHost())) {
|
||||
conf.setProxyHost(proxyConfig.getHost());
|
||||
}
|
||||
if (proxyConfig.getPort() != -1) {
|
||||
conf.setProxyPort(proxyConfig.getPort());
|
||||
}
|
||||
if (org.apache.commons.lang.StringUtils.isNotEmpty(proxyConfig.getUsername())) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(proxyConfig.getUsername())) {
|
||||
conf.setProxyUsername(proxyConfig.getUsername());
|
||||
}
|
||||
if (org.apache.commons.lang.StringUtils.isNotEmpty(proxyConfig.getPassword())) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(proxyConfig.getPassword())) {
|
||||
conf.setProxyPassword(proxyConfig.getPassword());
|
||||
}
|
||||
return conf;
|
||||
|
|
|
@ -92,10 +92,6 @@
|
|||
<groupId>com.google.inject.extensions</groupId>
|
||||
<artifactId>guice-multibindings</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
<artifactId>jsr311-api</artifactId>
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.google.common.base.Throwables;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.druid.indexer.DataSegmentAndIndexZipFilePath;
|
||||
import org.apache.druid.indexer.HadoopDruidDetermineConfigurationJob;
|
||||
import org.apache.druid.indexer.HadoopDruidIndexerConfig;
|
||||
|
|
|
@ -40,7 +40,7 @@ import com.google.common.util.concurrent.ListenableScheduledFuture;
|
|||
import com.google.common.util.concurrent.ListeningScheduledExecutorService;
|
||||
import com.google.common.util.concurrent.MoreExecutors;
|
||||
import com.google.common.util.concurrent.SettableFuture;
|
||||
import org.apache.commons.lang.mutable.MutableInt;
|
||||
import org.apache.commons.lang3.mutable.MutableInt;
|
||||
import org.apache.curator.framework.CuratorFramework;
|
||||
import org.apache.curator.framework.recipes.cache.PathChildrenCache;
|
||||
import org.apache.curator.framework.recipes.cache.PathChildrenCacheListener;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package org.apache.druid.indexing.seekablestream.supervisor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.apache.druid.indexing.overlord.supervisor.SupervisorStateManager;
|
||||
import org.apache.druid.indexing.overlord.supervisor.SupervisorStateManagerConfig;
|
||||
import org.apache.druid.indexing.seekablestream.common.StreamException;
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.druid.indexing.input;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import org.apache.commons.lang.mutable.MutableBoolean;
|
||||
import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||
import org.apache.druid.data.input.BytesCountingInputEntity;
|
||||
import org.apache.druid.data.input.ColumnsFilter;
|
||||
import org.apache.druid.data.input.InputEntity;
|
||||
|
|
9
pom.xml
9
pom.xml
|
@ -508,6 +508,10 @@
|
|||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>net.hydromatic</groupId>
|
||||
<artifactId>aggdesigner-algorithm</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -1397,6 +1401,11 @@
|
|||
<artifactId>rewrite-testing-frameworks</artifactId>
|
||||
<version>2.6.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openrewrite.recipe</groupId>
|
||||
<artifactId>rewrite-apache</artifactId>
|
||||
<version>1.2.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
@ -74,8 +74,8 @@
|
|||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
|
@ -422,11 +422,6 @@
|
|||
<artifactId>hamcrest-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
|
|
|
@ -24,7 +24,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||
import com.google.common.collect.Iterators;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.primitives.Ints;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.data.input.AbstractInputSource;
|
||||
import org.apache.druid.data.input.FilePerSplitHintSpec;
|
||||
import org.apache.druid.data.input.InputEntity;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package org.apache.druid.frame.read.columnar;
|
||||
|
||||
import com.google.common.primitives.Ints;
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.datasketches.memory.Memory;
|
||||
import org.apache.druid.common.config.NullHandling;
|
||||
import org.apache.druid.error.DruidException;
|
||||
|
|
|
@ -824,4 +824,13 @@ public class StringUtils
|
|||
throw new ISE(e, "Cannot load resource: [%s]", resource);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
This method is removed from commons lang3.
|
||||
https://commons.apache.org/proper/commons-lang/article3_0.html
|
||||
*/
|
||||
public static String escapeSql(String str)
|
||||
{
|
||||
return str == null ? null : StringUtils.replace(str, "'", "''");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.apache.druid.java.util.common.lifecycle;
|
|||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.java.util.common.ISE;
|
||||
import org.apache.druid.java.util.common.logger.Logger;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import com.google.common.base.Function;
|
|||
import com.google.common.base.Splitter;
|
||||
import com.google.common.primitives.Doubles;
|
||||
import com.google.common.primitives.Longs;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.druid.common.config.NullHandling;
|
||||
import org.joda.time.DateTimeZone;
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class ParserUtils
|
|||
@Nullable
|
||||
private static Object tryParseStringAsNumber(@Nullable final String input)
|
||||
{
|
||||
if (!NumberUtils.isNumber(input)) {
|
||||
if (!NumberUtils.isCreatable(input)) {
|
||||
return NullHandling.emptyToNullIfNeeded(input);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.apache.druid.math.expr;
|
|||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.errorprone.annotations.Immutable;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
import org.apache.druid.common.config.NullHandling;
|
||||
import org.apache.druid.java.util.common.IAE;
|
||||
import org.apache.druid.java.util.common.StringUtils;
|
||||
|
@ -427,7 +427,7 @@ class StringExpr extends ConstantExpr<String>
|
|||
public String stringify()
|
||||
{
|
||||
// escape as javascript string since string literals are wrapped in single quotes
|
||||
return value == null ? NULL_LITERAL : StringUtils.format("'%s'", StringEscapeUtils.escapeJavaScript(value));
|
||||
return value == null ? NULL_LITERAL : StringUtils.format("'%s'", StringEscapeUtils.escapeEcmaScript(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -482,7 +482,7 @@ class ArrayExpr extends ConstantExpr<Object[]>
|
|||
.map(s -> s == null
|
||||
? NULL_LITERAL
|
||||
// escape as javascript string since string literals are wrapped in single quotes
|
||||
: StringUtils.format("'%s'", StringEscapeUtils.escapeJavaScript((String) s))
|
||||
: StringUtils.format("'%s'", StringEscapeUtils.escapeEcmaScript((String) s))
|
||||
)
|
||||
.iterator()
|
||||
)
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.apache.druid.math.expr;
|
|||
|
||||
import org.antlr.v4.runtime.tree.ParseTree;
|
||||
import org.antlr.v4.runtime.tree.TerminalNode;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
import org.apache.druid.annotations.UsedInGeneratedCode;
|
||||
import org.apache.druid.java.util.common.Numbers;
|
||||
import org.apache.druid.java.util.common.RE;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package org.apache.druid.math.expr;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
import org.apache.druid.java.util.common.StringUtils;
|
||||
import org.apache.druid.math.expr.vector.ExprVectorProcessor;
|
||||
import org.apache.druid.math.expr.vector.VectorProcessors;
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.druid.query;
|
|||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.java.util.common.ISE;
|
||||
import org.apache.druid.java.util.common.Pair;
|
||||
import org.apache.druid.java.util.common.guava.MergeSequence;
|
||||
|
|
|
@ -97,7 +97,7 @@ class ContainsExpr extends ExprMacroTable.BaseScalarMacroFunctionExpr
|
|||
if (caseSensitive) {
|
||||
return s -> s.contains(searchString);
|
||||
} else {
|
||||
return s -> org.apache.commons.lang.StringUtils.containsIgnoreCase(s, searchString);
|
||||
return s -> org.apache.commons.lang3.StringUtils.containsIgnoreCase(s, searchString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class ContainsSearchQuerySpec implements SearchQuerySpec
|
|||
if (caseSensitive) {
|
||||
return dimVal.contains(value);
|
||||
}
|
||||
return org.apache.commons.lang.StringUtils.containsIgnoreCase(dimVal, value);
|
||||
return org.apache.commons.lang3.StringUtils.containsIgnoreCase(dimVal, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -85,7 +85,7 @@ public class FragmentSearchQuerySpec implements SearchQuerySpec
|
|||
return containsAny(target, dimVal);
|
||||
}
|
||||
for (String search : target) {
|
||||
if (!org.apache.commons.lang.StringUtils.containsIgnoreCase(dimVal, search)) {
|
||||
if (!org.apache.commons.lang3.StringUtils.containsIgnoreCase(dimVal, search)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
|||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Ordering;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.java.util.common.granularity.Granularity;
|
||||
import org.apache.druid.query.BaseQuery;
|
||||
import org.apache.druid.query.DataSource;
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.google.common.collect.ImmutableMap;
|
|||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.inject.Inject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.data.input.MapBasedRow;
|
||||
import org.apache.druid.frame.Frame;
|
||||
import org.apache.druid.frame.allocation.MemoryAllocatorFactory;
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.ning.compress.lzf.LZFDecoder;
|
|||
import com.ning.compress.lzf.LZFEncoder;
|
||||
import net.jpountz.lz4.LZ4Factory;
|
||||
import net.jpountz.lz4.LZ4SafeDecompressor;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.druid.collections.ResourceHolder;
|
||||
import org.apache.druid.java.util.common.ByteBufferUtils;
|
||||
import org.apache.druid.java.util.common.StringUtils;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package org.apache.druid.tasklogs;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import org.apache.commons.lang.NotImplementedException;
|
||||
import org.apache.commons.lang3.NotImplementedException;
|
||||
import org.apache.druid.guice.annotations.ExtensionPoint;
|
||||
import org.apache.druid.java.util.common.StringUtils;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package org.apache.druid.java.util.common.logger;
|
||||
|
||||
import org.apache.commons.lang.mutable.MutableInt;
|
||||
import org.apache.commons.lang3.mutable.MutableInt;
|
||||
import org.apache.druid.java.util.common.DateTimes;
|
||||
import org.apache.druid.java.util.common.StringUtils;
|
||||
import org.apache.druid.timeline.DataSegment;
|
||||
|
@ -125,7 +125,7 @@ public class LoggerTest
|
|||
Logger.logSegmentIds(logger, segments, "Many segments");
|
||||
|
||||
final int expected = (int) Math.ceil((double) numSegments / Logger.SEGMENTS_PER_LOG_MESSAGE);
|
||||
Assert.assertEquals(expected, msgCount.getValue());
|
||||
Assert.assertEquals(expected, msgCount.intValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package org.apache.druid.query.aggregation.constant;
|
||||
|
||||
import org.apache.commons.lang.math.RandomUtils;
|
||||
import org.apache.commons.lang3.RandomUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -52,7 +52,7 @@ public class LongConstantAggregatorTest
|
|||
@Test
|
||||
public void testFloat()
|
||||
{
|
||||
Assert.assertEquals((float) randomVal, aggregator.getFloat(), 0.0001f);
|
||||
Assert.assertEquals(randomVal, aggregator.getFloat(), 0.0001f);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package org.apache.druid.query.aggregation.constant;
|
||||
|
||||
import org.apache.commons.lang.math.RandomUtils;
|
||||
import org.apache.commons.lang3.RandomUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -57,7 +57,7 @@ public class LongConstantBufferAggregatorTest
|
|||
@Test
|
||||
public void testFloat()
|
||||
{
|
||||
Assert.assertEquals((float) randomVal, aggregator.getFloat(byteBuffer, 0), 0.0001f);
|
||||
Assert.assertEquals(randomVal, aggregator.getFloat(byteBuffer, 0), 0.0001f);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package org.apache.druid.query.aggregation.constant;
|
||||
|
||||
import org.apache.commons.lang.math.RandomUtils;
|
||||
import org.apache.commons.lang3.RandomUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.google.common.collect.ImmutableList;
|
|||
import com.google.common.collect.Lists;
|
||||
import com.google.common.io.CharSource;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.java.util.common.DateTimes;
|
||||
import org.apache.druid.java.util.common.Intervals;
|
||||
import org.apache.druid.java.util.common.concurrent.Execs;
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.google.common.collect.Sets;
|
|||
import com.google.common.hash.Hashing;
|
||||
import com.google.common.io.CharSource;
|
||||
import com.google.common.io.LineProcessor;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.druid.common.config.NullHandling;
|
||||
import org.apache.druid.hll.HyperLogLogCollector;
|
||||
import org.apache.druid.java.util.common.DateTimes;
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.google.common.collect.ImmutableList;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.io.CharSource;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.java.util.common.DateTimes;
|
||||
import org.apache.druid.java.util.common.Intervals;
|
||||
import org.apache.druid.java.util.common.UOE;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package org.apache.druid.tasklogs;
|
||||
|
||||
import org.apache.commons.lang.NotImplementedException;
|
||||
import org.apache.commons.lang3.NotImplementedException;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ recipeList:
|
|||
- org.openrewrite.java.testing.junit5.RemoveObsoleteRunners:
|
||||
obsoleteRunners:
|
||||
- org.junit.experimental.runners.Enclosed
|
||||
- org.openrewrite.apache.commons.lang.UpgradeApacheCommonsLang_2_3
|
||||
---
|
||||
type: specs.openrewrite.org/v1beta/recipe
|
||||
name: org.apache.druid.UpgradeCalciteTestsToJunit5
|
||||
|
|
|
@ -308,10 +308,6 @@
|
|||
<groupId>com.google.errorprone</groupId>
|
||||
<artifactId>error_prone_annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.fasterxml.jackson.core.JsonGenerator;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.apache.commons.lang.mutable.MutableBoolean;
|
||||
import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||
import org.apache.druid.java.util.common.guava.Sequence;
|
||||
import org.apache.druid.java.util.common.guava.SequenceWrapper;
|
||||
import org.apache.druid.java.util.common.guava.Sequences;
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.apache.druid.indexing.overlord.supervisor;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.apache.druid.indexer.TaskState;
|
||||
import org.apache.druid.java.util.common.DateTimes;
|
||||
import org.joda.time.DateTime;
|
||||
|
|
|
@ -31,7 +31,6 @@ import com.google.common.collect.Lists;
|
|||
import com.google.common.hash.Hashing;
|
||||
import com.google.common.io.BaseEncoding;
|
||||
import com.google.inject.Inject;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.druid.error.InvalidInput;
|
||||
import org.apache.druid.indexing.overlord.DataSourceMetadata;
|
||||
import org.apache.druid.indexing.overlord.IndexerMetadataStorageCoordinator;
|
||||
|
@ -2533,7 +2532,7 @@ public class IndexerSQLMetadataStorageCoordinator implements IndexerMetadataStor
|
|||
List<List<DataSegment>> segmentsLists = Lists.partition(new ArrayList<>(segments), MAX_NUM_SEGMENTS_TO_ANNOUNCE_AT_ONCE);
|
||||
for (List<DataSegment> segmentList : segmentsLists) {
|
||||
String segmentIds = segmentList.stream()
|
||||
.map(segment -> "'" + StringEscapeUtils.escapeSql(segment.getId().toString()) + "'")
|
||||
.map(segment -> "'" + StringUtils.escapeSql(segment.getId().toString()) + "'")
|
||||
.collect(Collectors.joining(","));
|
||||
List<String> existIds = handle.createQuery(StringUtils.format("SELECT id FROM %s WHERE id in (%s)", dbTables.getSegmentsTable(), segmentIds))
|
||||
.mapTo(String.class)
|
||||
|
|
|
@ -1031,7 +1031,7 @@ public abstract class SQLMetadataConnector implements MetadataStorageConnector
|
|||
ResultSet resultSet = getIndexInfo(databaseMetaData, tableName);
|
||||
while (resultSet.next()) {
|
||||
String indexName = resultSet.getString("INDEX_NAME");
|
||||
if (org.apache.commons.lang.StringUtils.isNotBlank(indexName)) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(indexName)) {
|
||||
res.add(StringUtils.toUpperCase(indexName));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import com.google.common.base.Strings;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.inject.Inject;
|
||||
import org.apache.commons.lang.mutable.MutableBoolean;
|
||||
import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||
import org.apache.druid.client.coordinator.Coordinator;
|
||||
import org.apache.druid.concurrent.LifecycleLock;
|
||||
import org.apache.druid.discovery.DruidLeaderClient;
|
||||
|
|
|
@ -26,7 +26,6 @@ import com.google.common.collect.Collections2;
|
|||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.inject.Inject;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.druid.guice.LazySingleton;
|
||||
import org.apache.druid.java.util.common.DateTimes;
|
||||
import org.apache.druid.java.util.common.ISE;
|
||||
|
@ -362,7 +361,7 @@ public class SegmentSchemaManager
|
|||
Map<Boolean, Set<String>> existingFingerprints = new HashMap<>();
|
||||
for (List<String> fingerprintList : partitionedFingerprints) {
|
||||
String fingerprints = fingerprintList.stream()
|
||||
.map(fingerprint -> "'" + StringEscapeUtils.escapeSql(fingerprint) + "'")
|
||||
.map(fingerprint -> "'" + StringUtils.escapeSql(fingerprint) + "'")
|
||||
.collect(Collectors.joining(","));
|
||||
handle.createQuery(
|
||||
StringUtils.format(
|
||||
|
@ -380,7 +379,7 @@ public class SegmentSchemaManager
|
|||
private String getInClause(final Stream<String> ids)
|
||||
{
|
||||
return ids
|
||||
.map(value -> "'" + StringEscapeUtils.escapeSql(value) + "'")
|
||||
.map(value -> "'" + StringUtils.escapeSql(value) + "'")
|
||||
.collect(Collectors.joining(","));
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import com.google.common.util.concurrent.Futures;
|
|||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
import com.google.common.util.concurrent.ListeningExecutorService;
|
||||
import com.google.common.util.concurrent.MoreExecutors;
|
||||
import org.apache.commons.lang.mutable.MutableLong;
|
||||
import org.apache.commons.lang3.mutable.MutableLong;
|
||||
import org.apache.druid.client.cache.Cache;
|
||||
import org.apache.druid.data.input.Committer;
|
||||
import org.apache.druid.data.input.InputRow;
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.inject.Inject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.client.CachingClusteredClient;
|
||||
import org.apache.druid.client.DirectDruidClient;
|
||||
import org.apache.druid.client.cache.Cache;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package org.apache.druid.server.compaction;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.druid.client.indexing.ClientCompactionTaskGranularitySpec;
|
||||
import org.apache.druid.client.indexing.ClientCompactionTaskQueryTuningConfig;
|
||||
import org.apache.druid.client.indexing.ClientCompactionTaskTransformSpec;
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.google.common.collect.Iterables;
|
|||
import com.google.inject.Inject;
|
||||
import com.sun.jersey.spi.container.ResourceFilters;
|
||||
import it.unimi.dsi.fastutil.objects.Object2LongMap;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.audit.AuditEntry;
|
||||
import org.apache.druid.audit.AuditManager;
|
||||
import org.apache.druid.client.CoordinatorServerView;
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.apache.druid.server.initialization.jetty;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.inject.Inject;
|
||||
import org.apache.commons.lang.CharUtils;
|
||||
import org.apache.commons.lang3.CharUtils;
|
||||
import org.apache.druid.java.util.common.IAE;
|
||||
import org.apache.druid.server.initialization.ServerConfig;
|
||||
import org.eclipse.jetty.client.api.Response;
|
||||
|
|
|
@ -138,8 +138,8 @@
|
|||
<artifactId>error_prone_annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
|||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Optional;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.druid.java.util.common.logger.Logger;
|
||||
import org.apache.druid.query.Query;
|
||||
import org.apache.druid.query.QueryContext;
|
||||
|
|
Loading…
Reference in New Issue