This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 821bfa5 [SPARK-37968][BUILD][CORE] Upgrade commons-collections 3.x to
commons-collections4
821bfa5 is described below
commit 821bfa51f3014e30b302d17f1423a48b46384541
Author: yangjie01 <[email protected]>
AuthorDate: Thu Jan 20 11:02:02 2022 -0800
[SPARK-37968][BUILD][CORE] Upgrade commons-collections 3.x to
commons-collections4
### What changes were proposed in this pull request?
`Apache commons-collections` 3.x is a Java 1.3 compatible version, and it
does not use Java 5 generics. `Apache commons-collections4` 4.4 is an upgraded
version of `commons-collections` and it built by Java 8.
So this pr upgraded this dependency and fixed the code that block
compilation due to this upgrade.
### Why are the changes needed?
Dependency upgrade, the release notes as follows:
-
https://commons.apache.org/proper/commons-collections/changes-report.html#a4.4
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pass GA
Closes #35257 from LuciferYang/commons-collections4.
Authored-by: yangjie01 <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
core/pom.xml | 4 ++--
.../main/scala/org/apache/spark/broadcast/BroadcastManager.scala | 5 +++--
dev/deps/spark-deps-hadoop-2-hive-2.3 | 1 +
dev/deps/spark-deps-hadoop-3-hive-2.3 | 2 +-
pom.xml | 6 +++---
5 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/core/pom.xml b/core/pom.xml
index 8c9bbd3..ac429fc 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -193,8 +193,8 @@
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
diff --git
a/core/src/main/scala/org/apache/spark/broadcast/BroadcastManager.scala
b/core/src/main/scala/org/apache/spark/broadcast/BroadcastManager.scala
index 989a194..b6f59c3 100644
--- a/core/src/main/scala/org/apache/spark/broadcast/BroadcastManager.scala
+++ b/core/src/main/scala/org/apache/spark/broadcast/BroadcastManager.scala
@@ -22,7 +22,8 @@ import java.util.concurrent.atomic.AtomicLong
import scala.reflect.ClassTag
-import org.apache.commons.collections.map.{AbstractReferenceMap, ReferenceMap}
+import
org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength
+import org.apache.commons.collections4.map.ReferenceMap
import org.apache.spark.SparkConf
import org.apache.spark.api.python.PythonBroadcast
@@ -55,7 +56,7 @@ private[spark] class BroadcastManager(
private[broadcast] val cachedValues =
Collections.synchronizedMap(
- new ReferenceMap(AbstractReferenceMap.HARD, AbstractReferenceMap.WEAK)
+ new ReferenceMap(ReferenceStrength.HARD, ReferenceStrength.WEAK)
.asInstanceOf[java.util.Map[Any, Any]]
)
diff --git a/dev/deps/spark-deps-hadoop-2-hive-2.3
b/dev/deps/spark-deps-hadoop-2-hive-2.3
index 09b01a3..adefbe1 100644
--- a/dev/deps/spark-deps-hadoop-2-hive-2.3
+++ b/dev/deps/spark-deps-hadoop-2-hive-2.3
@@ -38,6 +38,7 @@ commons-beanutils/1.9.4//commons-beanutils-1.9.4.jar
commons-cli/1.5.0//commons-cli-1.5.0.jar
commons-codec/1.15//commons-codec-1.15.jar
commons-collections/3.2.2//commons-collections-3.2.2.jar
+commons-collections4/4.4//commons-collections4-4.4.jar
commons-compiler/3.0.16//commons-compiler-3.0.16.jar
commons-compress/1.21//commons-compress-1.21.jar
commons-configuration/1.6//commons-configuration-1.6.jar
diff --git a/dev/deps/spark-deps-hadoop-3-hive-2.3
b/dev/deps/spark-deps-hadoop-3-hive-2.3
index b7cc91f..a57b7dc 100644
--- a/dev/deps/spark-deps-hadoop-3-hive-2.3
+++ b/dev/deps/spark-deps-hadoop-3-hive-2.3
@@ -39,7 +39,7 @@ chill-java/0.10.0//chill-java-0.10.0.jar
chill_2.12/0.10.0//chill_2.12-0.10.0.jar
commons-cli/1.5.0//commons-cli-1.5.0.jar
commons-codec/1.15//commons-codec-1.15.jar
-commons-collections/3.2.2//commons-collections-3.2.2.jar
+commons-collections4/4.4//commons-collections4-4.4.jar
commons-compiler/3.0.16//commons-compiler-3.0.16.jar
commons-compress/1.21//commons-compress-1.21.jar
commons-crypto/1.1.0//commons-crypto-1.1.0.jar
diff --git a/pom.xml b/pom.xml
index 4f53da0..62f3d1b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -159,7 +159,7 @@
<commons.httpcore.version>4.4.14</commons.httpcore.version>
<commons.math3.version>3.4.1</commons.math3.version>
<!-- managed up from 3.2.1 for SPARK-11652 -->
- <commons.collections.version>3.2.2</commons.collections.version>
+ <commons.collections.version>4.4</commons.collections.version>
<scala.version>2.12.15</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<scalatest-maven-plugin.version>2.0.2</scalatest-maven-plugin.version>
@@ -612,8 +612,8 @@
<version>${commons.math3.version}</version>
</dependency>
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
<version>${commons.collections.version}</version>
</dependency>
<dependency>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]