You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ab...@apache.org on 2023/11/17 10:31:43 UTC
(solr-sandbox) branch main updated: Upgrade Kafka to version 3.5.1. (#85)
This is an automated email from the ASF dual-hosted git repository.
ab pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-sandbox.git
The following commit(s) were added to refs/heads/main by this push:
new 081edd5 Upgrade Kafka to version 3.5.1. (#85)
081edd5 is described below
commit 081edd547fe13222f008733fca4c352fbab8596c
Author: Andrzej BiaĆecki <ab...@apache.org>
AuthorDate: Fri Nov 17 11:31:38 2023 +0100
Upgrade Kafka to version 3.5.1. (#85)
---
crossdc-commons/build.gradle | 14 +++----------
crossdc-consumer/build.gradle | 8 ++++----
crossdc-producer/build.gradle | 11 ++++++-----
.../handler/admin/MirroringConfigSetsHandler.java | 1 +
.../admin/MirroringConfigSetsHandlerTest.java | 23 +++++++++++-----------
5 files changed, 25 insertions(+), 32 deletions(-)
diff --git a/crossdc-commons/build.gradle b/crossdc-commons/build.gradle
index b926137..b8172dc 100644
--- a/crossdc-commons/build.gradle
+++ b/crossdc-commons/build.gradle
@@ -34,11 +34,8 @@ sourceSets {
}
dependencies {
- provided 'org.apache.solr:solr-solrj:8.11.2', {
- exclude group: "org.apache.logging.log4j", module: "*"
- exclude group: "org.slf4j", module: "*"
- }
- implementation 'org.apache.kafka:kafka-clients:2.8.1'
+ provided 'org.apache.solr:solr-solrj:8.11.2'
+ implementation 'org.apache.kafka:kafka-clients:3.5.1'
implementation 'com.google.guava:guava:14.0'
testImplementation 'org.slf4j:slf4j-api:2.0.5'
testImplementation 'org.hamcrest:hamcrest:2.2'
@@ -46,16 +43,11 @@ dependencies {
testImplementation('org.mockito:mockito-inline:5.2.0')
testImplementation group: 'org.apache.solr', name: 'solr-core', version: '8.11.2', {
- exclude group: "org.apache.logging.log4j", module: "*"
- exclude group: "org.slf4j", module: "*"
exclude group: "org.eclipse.jetty", module: "jetty-http"
exclude group: "org.eclipse.jetty", module: "jetty-server"
exclude group: "org.eclipse.jetty", module: "jetty-servlet"
}
- testImplementation group: 'org.apache.solr', name: 'solr-test-framework', version: '8.11.2', {
- exclude group: "org.apache.logging.log4j", module: "*"
- exclude group: "org.slf4j", module: "*"
- }
+ testImplementation group: 'org.apache.solr', name: 'solr-test-framework', version: '8.11.2'
}
jar.enabled = false
diff --git a/crossdc-consumer/build.gradle b/crossdc-consumer/build.gradle
index 67668d0..37c3c6d 100644
--- a/crossdc-consumer/build.gradle
+++ b/crossdc-consumer/build.gradle
@@ -60,10 +60,10 @@ dependencies {
exclude group: "org.apache.logging.log4j", module: "*"
exclude group: "org.slf4j", module: "*"
}
- implementation 'org.apache.kafka:kafka_2.13:2.8.1'
- implementation 'org.apache.kafka:kafka-streams:2.8.1'
- testImplementation 'org.apache.kafka:kafka_2.13:2.8.1:test'
- testImplementation 'org.apache.kafka:kafka-streams:2.8.1:test'
+ implementation 'org.apache.kafka:kafka_2.13:3.5.1'
+ implementation 'org.apache.kafka:kafka-streams:3.5.1'
+ testImplementation 'org.apache.kafka:kafka_2.13:3.5.1:test'
+ testImplementation 'org.apache.kafka:kafka-streams:3.5.1:test'
}
test {
diff --git a/crossdc-producer/build.gradle b/crossdc-producer/build.gradle
index 5d91ced..20389bb 100644
--- a/crossdc-producer/build.gradle
+++ b/crossdc-producer/build.gradle
@@ -45,12 +45,13 @@ dependencies {
testImplementation group: 'org.apache.solr', name: 'solr-core', version: '8.11.2'
testImplementation group: 'org.apache.solr', name: 'solr-test-framework', version: '8.11.2'
- testImplementation 'org.apache.kafka:kafka_2.13:2.8.1'
- testImplementation 'org.apache.kafka:kafka-streams:2.8.1'
- testImplementation 'org.apache.kafka:kafka_2.13:2.8.1:test'
- testImplementation 'org.apache.kafka:kafka-streams:2.8.1:test'
+ testImplementation 'org.apache.kafka:kafka-clients:3.5.1:test'
+ testImplementation 'org.apache.kafka:kafka_2.13:3.5.1'
+ testImplementation 'org.apache.kafka:kafka-streams:3.5.1'
+ testImplementation 'org.apache.kafka:kafka_2.13:3.5.1:test'
+ testImplementation 'org.apache.kafka:kafka-streams:3.5.1:test'
+ testImplementation 'org.apache.kafka:kafka-server-common:3.5.1:test'
- testImplementation 'org.apache.kafka:kafka-clients:2.8.1:test'
}
jar.enabled = false
diff --git a/crossdc-producer/src/main/java/org/apache/solr/handler/admin/MirroringConfigSetsHandler.java b/crossdc-producer/src/main/java/org/apache/solr/handler/admin/MirroringConfigSetsHandler.java
index be766f5..cabbf29 100644
--- a/crossdc-producer/src/main/java/org/apache/solr/handler/admin/MirroringConfigSetsHandler.java
+++ b/crossdc-producer/src/main/java/org/apache/solr/handler/admin/MirroringConfigSetsHandler.java
@@ -64,6 +64,7 @@ public class MirroringConfigSetsHandler extends ConfigSetsHandler {
zkClient = coreContainer.getZkController().getZkClient();
}
ConfUtil.fillProperties(zkClient, properties);
+ ConfUtil.verifyProperties(properties);
KafkaCrossDcConf conf = new KafkaCrossDcConf(properties);
this.sink = new KafkaMirroringSink(conf);
} catch (Exception e) {
diff --git a/crossdc-producer/src/test/java/org/apache/solr/handler/admin/MirroringConfigSetsHandlerTest.java b/crossdc-producer/src/test/java/org/apache/solr/handler/admin/MirroringConfigSetsHandlerTest.java
index d2aa0a5..04f2f4e 100644
--- a/crossdc-producer/src/test/java/org/apache/solr/handler/admin/MirroringConfigSetsHandlerTest.java
+++ b/crossdc-producer/src/test/java/org/apache/solr/handler/admin/MirroringConfigSetsHandlerTest.java
@@ -16,12 +16,14 @@
*/
package org.apache.solr.handler.admin;
+import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
+import com.carrotsearch.randomizedtesting.annotations.ThreadLeakLingering;
import org.apache.commons.io.IOUtils;
+import org.apache.lucene.util.QuickPatchThreadsFilter;
+import org.apache.solr.SolrIgnoredThreadsFilter;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.SolrRequest;
-import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.cloud.ZkController;
-import org.apache.solr.common.cloud.Replica;
import org.apache.solr.common.cloud.SolrZkClient;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ConfigSetParams;
@@ -30,15 +32,15 @@ import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.ContentStream;
import org.apache.solr.common.util.ContentStreamBase;
import org.apache.solr.core.CoreContainer;
+import org.apache.solr.core.NodeConfig;
import org.apache.solr.core.SolrCore;
import org.apache.solr.core.SolrXmlConfig;
-import org.apache.solr.crossdc.common.CrossDcConf;
+import org.apache.solr.crossdc.SolrKafkaTestsIgnoredThreadsFilter;
import org.apache.solr.crossdc.common.KafkaMirroringSink;
import org.apache.solr.crossdc.common.MirroredSolrRequest;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.SolrQueryResponse;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
@@ -47,9 +49,11 @@ import org.mockito.Mockito;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.util.Arrays;
-import java.util.Collection;
import java.util.List;
+@ThreadLeakFilters(defaultFilters = true, filters = { SolrIgnoredThreadsFilter.class,
+ QuickPatchThreadsFilter.class, SolrKafkaTestsIgnoredThreadsFilter.class })
+@ThreadLeakLingering(linger = 5000)
public class MirroringConfigSetsHandlerTest extends SolrTestCaseJ4 {
private KafkaMirroringSink sink = Mockito.mock(KafkaMirroringSink.class);
@@ -140,12 +144,7 @@ public class MirroringConfigSetsHandlerTest extends SolrTestCaseJ4 {
public void testCoreContainerInit() throws Exception {
Path home = createTempDir();
String solrXml = IOUtils.resourceToString("/mirroring-solr.xml", StandardCharsets.UTF_8);
- CoreContainer cores = new CoreContainer(SolrXmlConfig.fromString(home, solrXml));
- try {
- cores.load();
- assertTrue(cores.getConfigSetsHandler() instanceof MirroringConfigSetsHandler);
- } finally {
- cores.shutdown();
- }
+ NodeConfig nodeConfig = SolrXmlConfig.fromString(home, solrXml);
+ assertEquals(MirroringConfigSetsHandler.class.getName(), nodeConfig.getConfigSetsHandlerClass());
}
}