Skip to content

Commit 40a628c

Browse files
committed
Revert "Update dependencies to resolve vulnerabilities (#183)"
This reverts commit 0bb284e.
1 parent 3e9a95d commit 40a628c

File tree

5 files changed

+11
-26
lines changed

5 files changed

+11
-26
lines changed

pom.xml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,21 @@
6666

6767
<!-- dependencies -->
6868
<!-- latest version from apache pulsar -->
69-
<pulsar.version>4.0.5</pulsar.version>
69+
<pulsar.version>2.10.5</pulsar.version>
7070
<scala.version>2.13.12</scala.version>
7171
<scala.binary.version>2.13</scala.binary.version>
7272
<scalatest.version>3.2.14</scalatest.version>
7373
<spark.version>3.4.1</spark.version>
74-
<commons-io.version>2.19.0</commons-io.version>
74+
<commons-io.version>2.11.0</commons-io.version>
7575
<testcontainers.version>1.18.3</testcontainers.version>
76-
<bouncycastle.version>1.78</bouncycastle.version>
7776

7877
<!-- plugin dependencies -->
7978
<maven.version>3.5.4</maven.version>
8079
<mvn-scalafmt.version>1.1.1640084764.9f463a9</mvn-scalafmt.version>
8180
<license-maven-plugin.version>4.1</license-maven-plugin.version>
8281
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
8382
<maven-dependency-plugin.version>3.3.0</maven-dependency-plugin.version>
84-
<maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
83+
<maven-shade-plugin.version>3.4.0</maven-shade-plugin.version>
8584
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
8685
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
8786
<scala-maven-plugin.version>4.8.1</scala-maven-plugin.version>
@@ -155,12 +154,6 @@
155154
<version>${commons-io.version}</version>
156155
</dependency>
157156

158-
<dependency>
159-
<groupId>org.bouncycastle</groupId>
160-
<artifactId>bcprov-jdk18on</artifactId>
161-
<version>${bouncycastle.version}</version>
162-
</dependency>
163-
164157
<!-- spark dependency -->
165158

166159
<dependency>
@@ -396,7 +389,6 @@
396389
<include>org.bouncycastle*:*</include>
397390
<include>org.lz4*:*</include>
398391
<include>commons-io:commons-io:jar:*</include>
399-
<include>io.opentelemetry:*</include> <!-- Add this -->
400392
</includes>
401393
</artifactSet>
402394
<filters>
@@ -416,10 +408,6 @@
416408
</filter>
417409
</filters>
418410
<relocations>
419-
<relocation>
420-
<pattern>io.opentelemetry</pattern>
421-
<shadedPattern>org.apache.pulsar.shade.io.opentelemetry</shadedPattern>
422-
</relocation>
423411
<relocation>
424412
<pattern>com.google</pattern>
425413
<shadedPattern>org.apache.pulsar.shade.com.google</shadedPattern>

src/main/scala/org/apache/spark/sql/pulsar/PulsarConfigurationUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ import java.util.Locale
1818

1919
import scala.reflect._
2020

21-
import com.fasterxml.jackson.annotation.JsonIgnore
2221
import org.apache.pulsar.client.impl.conf.{
2322
ClientConfigurationData,
2423
ProducerConfigurationData,
2524
ReaderConfigurationData
2625
}
26+
import org.apache.pulsar.shade.com.fasterxml.jackson.annotation.JsonIgnore
2727

2828
object PulsarConfigurationUtils {
2929

src/main/scala/org/apache/spark/sql/pulsar/PulsarHelper.scala

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,8 @@ private[pulsar] case class PulsarHelper(
311311
private def getTopics(topicsPattern: String): Seq[String] = {
312312
val dest = TopicName.get(topicsPattern)
313313
val allTopics: ju.List[String] = client.getLookup
314-
.getTopicsUnderNamespace(
315-
// passing an empty topicsHash because we don't cache the GetTopicsResponse
316-
dest.getNamespaceObject, CommandGetTopicsOfNamespace.Mode.ALL, topicsPattern, "")
317-
.get().getTopics
314+
.getTopicsUnderNamespace(dest.getNamespaceObject, CommandGetTopicsOfNamespace.Mode.ALL)
315+
.get()
318316

319317
val allNonPartitionedTopics: ju.List[String] = allTopics.asScala
320318
.filter(t => !TopicName.get(t).isPartitioned)
@@ -350,9 +348,7 @@ private[pulsar] case class PulsarHelper(
350348
while (waitList.nonEmpty) {
351349
val topic = waitList.head
352350
try {
353-
// setting metadataAutoCreationEnabled to false, and useFallbackForNonPIP344Brokers
354-
// to true to conform to non-breaking behavior.
355-
client.getPartitionedTopicMetadata(topic, false, true).get()
351+
client.getPartitionedTopicMetadata(topic).get()
356352
waitList -= topic
357353
} catch {
358354
case NonFatal(_) =>

src/test/scala/org/apache/spark/sql/pulsar/PulsarAdmissionControlSuite.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import java.{util => ju}
44

55
import org.apache.pulsar.client.admin.PulsarAdmin
66
import org.apache.pulsar.client.api.MessageId
7+
import org.apache.pulsar.client.internal.DefaultImplementation
78
import org.apache.spark.sql.pulsar.PulsarSourceUtils.{getEntryId, getLedgerId}
89
import org.apache.spark.sql.streaming.Trigger.{Once, ProcessingTime}
910
import org.apache.spark.util.Utils
10-
import org.apache.pulsar.client.admin.PulsarAdminException.NotFoundException
1111

1212
class PulsarAdmissionControlSuite extends PulsarSourceTest {
1313

@@ -48,9 +48,10 @@ class PulsarAdmissionControlSuite extends PulsarSourceTest {
4848
// Need to call latestOffsetForTopicPartition so the helper instantiates
4949
// the admin
5050
val admissionControlHelper = new PulsarAdmissionControlHelper(adminUrl, conf)
51-
val e = intercept[NotFoundException] {
51+
val e = intercept[RuntimeException] {
5252
admissionControlHelper.latestOffsetForTopicPartition(topic, MessageId.earliest, approxSizeOfInt)
5353
}
54+
assert(e.getMessage.contains("Failed to load config into existing configuration data"))
5455
}
5556

5657
test("Admit entry in the middle of the ledger") {

src/test/scala/org/apache/spark/sql/pulsar/PulsarTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ trait PulsarTest extends BeforeAndAfterAll with BeforeAndAfterEach {
4949
self: SparkFunSuite =>
5050
import PulsarOptions._
5151

52-
val CURRENT_VERSION = "4.0.5"
52+
val CURRENT_VERSION = "2.10.2"
5353

5454
var pulsarContainer: PulsarContainer = null
5555
var serviceUrl: String = null

0 commit comments

Comments
 (0)