This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-connector-pulsar.git
The following commit(s) were added to refs/heads/main by this push:
new bc5ae99 [FLINK-30430][Connector/Pulsar] Remove all the useless
dependencies, drop mock runtime. (#9)
bc5ae99 is described below
commit bc5ae99848b4517ac351f3327fcc142c726eceac
Author: Yufan Sheng <[email protected]>
AuthorDate: Thu Dec 29 23:00:00 2022 +0800
[FLINK-30430][Connector/Pulsar] Remove all the useless dependencies, drop
mock runtime. (#9)
---
flink-connector-pulsar-e2e-tests/pom.xml | 31 +-
flink-connector-pulsar/pom.xml | 142 +-----
.../connector/pulsar/sink/PulsarSinkITCase.java | 2 +-
.../pulsar/source/PulsarSourceITCase.java | 2 +-
.../pulsar/source/PulsarUnorderedSourceITCase.java | 2 +-
.../pulsar/testutils/PulsarTestSuiteBase.java | 2 +-
.../pulsar/testutils/runtime/PulsarRuntime.java | 16 +-
.../testutils/runtime/PulsarRuntimeUtils.java | 124 ------
.../runtime/container/PulsarContainerRuntime.java | 11 +-
.../runtime/mock/BlankBrokerInterceptor.java | 61 ---
.../runtime/mock/MockBookKeeperClientFactory.java | 74 ----
.../testutils/runtime/mock/MockPulsarService.java | 57 ---
.../runtime/mock/NonClosableMockBookKeeper.java | 55 ---
.../testutils/runtime/mock/PulsarMockRuntime.java | 114 -----
.../mock/SameThreadOrderedSafeExecutor.java | 56 ---
flink-sql-connector-pulsar/pom.xml | 2 +-
pom.xml | 484 ++++++---------------
17 files changed, 166 insertions(+), 1069 deletions(-)
diff --git a/flink-connector-pulsar-e2e-tests/pom.xml
b/flink-connector-pulsar-e2e-tests/pom.xml
index 5798d1e..2ff0083 100644
--- a/flink-connector-pulsar-e2e-tests/pom.xml
+++ b/flink-connector-pulsar-e2e-tests/pom.xml
@@ -27,44 +27,29 @@ under the License.
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>flink-end-to-end-tests-pulsar</artifactId>
- <name>Flink : E2E Tests : Pulsar</name>
+ <artifactId>flink-connector-pulsar-e2e-tests</artifactId>
+ <name>Flink : Connectors : Pulsar : E2E Tests</name>
<properties>
- <jaxb-api.version>2.3.1</jaxb-api.version>
<japicmp.skip>true</japicmp.skip>
</properties>
<dependencies>
- <dependency>
- <groupId>org.apache.flink</groupId>
- <artifactId>flink-connector-test-utils</artifactId>
- <version>${flink.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-pulsar</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- pulsar-client-all requires jaxb-api for
javax.xml.bind.annotation.XmlElement -->
- <!-- packaged in flink-dist but not provided in e2e
environment. -->
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>${jaxb-api.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-pulsar</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
</dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-connector-test-utils</artifactId>
+ </dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>pulsar</artifactId>
@@ -114,10 +99,6 @@ under the License.
<build>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
diff --git a/flink-connector-pulsar/pom.xml b/flink-connector-pulsar/pom.xml
index b23309b..e7fcfe2 100644
--- a/flink-connector-pulsar/pom.xml
+++ b/flink-connector-pulsar/pom.xml
@@ -34,17 +34,6 @@ under the License.
<packaging>jar</packaging>
- <properties>
- <protoc.version>3.21.7</protoc.version>
-
- <!-- Test Libraries -->
-
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
- <os-maven-plugin.version>1.7.0</os-maven-plugin.version>
- <pulsar-netty.version>4.1.77.Final</pulsar-netty.version>
- <pulsar-grpc.version>1.45.1</pulsar-grpc.version>
- <pulsar-caffeine.version>2.9.1</pulsar-caffeine.version>
- </properties>
-
<dependencies>
<!-- Core -->
@@ -52,7 +41,6 @@ under the License.
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-base</artifactId>
- <version>${flink.version}</version>
</dependency>
<!-- Connectors -->
@@ -60,7 +48,6 @@ under the License.
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java</artifactId>
- <version>${flink.version}</version>
<scope>provided</scope>
</dependency>
@@ -69,11 +56,17 @@ under the License.
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
- <version>${protoc.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
+ <!-- Pulsar Client -->
+
+ <dependency>
+ <groupId>org.apache.pulsar</groupId>
+ <artifactId>pulsar-client-all</artifactId>
+ </dependency>
+
<!-- Tests -->
<dependency>
@@ -95,7 +88,6 @@ under the License.
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-test-utils</artifactId>
- <version>${flink.version}</version>
<scope>test</scope>
</dependency>
@@ -106,131 +98,13 @@ under the License.
<artifactId>pulsar</artifactId>
<scope>test</scope>
</dependency>
-
- <!-- Pulsar bundles the latest bookkeeper -->
- <!-- we don't override the version here. -->
- <dependency>
- <groupId>org.apache.pulsar</groupId>
- <artifactId>testmocks</artifactId>
- <version>${pulsar.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.powermock</groupId>
-
<artifactId>powermock-module-testng</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.pulsar</groupId>
- <artifactId>pulsar-broker</artifactId>
- <version>${pulsar.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.github.ben-manes.caffeine</groupId>
- <artifactId>caffeine</artifactId>
- <version>${pulsar-caffeine.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Add Pulsar 2.x as a dependency. -->
- <!-- Move this to button for avoiding class conflicts with
pulsar-broker. -->
-
- <dependency>
- <groupId>org.apache.pulsar</groupId>
- <artifactId>pulsar-client-all</artifactId>
- <version>${pulsar.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.sun.activation</groupId>
-
<artifactId>javax.activation</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jakarta.activation</groupId>
-
<artifactId>jakarta.activation-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jakarta.ws.rs</groupId>
-
<artifactId>jakarta.ws.rs-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jakarta.xml.bind</groupId>
-
<artifactId>jakarta.xml.bind-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>net.jcip</groupId>
-
<artifactId>jcip-annotations</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.pulsar</groupId>
-
<artifactId>pulsar-package-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.beust</groupId>
- <artifactId>jcommander</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- ArchUit test dependencies -->
-
- <dependency>
- <groupId>org.apache.flink</groupId>
- <artifactId>flink-architecture-tests-test</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
-
- <dependencyManagement>
- <dependencies>
- <!-- Pulsar use higher gRPC version. -->
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-bom</artifactId>
- <version>${pulsar-grpc.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <!-- Pulsar use higher netty version. -->
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-bom</artifactId>
- <version>${pulsar-netty.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
<build>
- <extensions>
- <extension>
- <groupId>kr.motd.maven</groupId>
- <artifactId>os-maven-plugin</artifactId>
- <version>${os-maven-plugin.version}</version>
- </extension>
- </extensions>
-
<plugins>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
-
<version>${protobuf-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<!-- Currently Flink azure test
pipeline would first pre-compile and then upload the compiled
@@ -247,7 +121,7 @@ under the License.
${project.build.directory}/generated-test-sources/protobuf/java
</outputDirectory>
<protocArtifact>
-
com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}
+
com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
</protocArtifact>
</configuration>
<executions>
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/sink/PulsarSinkITCase.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/sink/PulsarSinkITCase.java
index 690d7ff..e73d240 100644
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/sink/PulsarSinkITCase.java
+++
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/sink/PulsarSinkITCase.java
@@ -65,7 +65,7 @@ class PulsarSinkITCase {
@TestEnv MiniClusterTestEnvironment flink = new
MiniClusterTestEnvironment();
@TestExternalSystem
- PulsarTestEnvironment pulsar = new
PulsarTestEnvironment(PulsarRuntime.mock());
+ PulsarTestEnvironment pulsar = new
PulsarTestEnvironment(PulsarRuntime.container());
@TestSemantics
CheckpointingMode[] semantics =
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/source/PulsarSourceITCase.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/source/PulsarSourceITCase.java
index 016c133..7d819c9 100644
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/source/PulsarSourceITCase.java
+++
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/source/PulsarSourceITCase.java
@@ -46,7 +46,7 @@ class PulsarSourceITCase extends SourceTestSuiteBase<String> {
// Defines pulsar running environment
@TestExternalSystem
- PulsarTestEnvironment pulsar = new
PulsarTestEnvironment(PulsarRuntime.mock());
+ PulsarTestEnvironment pulsar = new
PulsarTestEnvironment(PulsarRuntime.container());
// This field is preserved, we don't support the semantics in source
currently.
@TestSemantics
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/source/PulsarUnorderedSourceITCase.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/source/PulsarUnorderedSourceITCase.java
index 8586c7d..dfb0631 100644
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/source/PulsarUnorderedSourceITCase.java
+++
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/source/PulsarUnorderedSourceITCase.java
@@ -45,7 +45,7 @@ public class PulsarUnorderedSourceITCase extends
UnorderedSourceTestSuiteBase<St
// Defines pulsar running environment
@TestExternalSystem
- PulsarTestEnvironment pulsar = new
PulsarTestEnvironment(PulsarRuntime.mock());
+ PulsarTestEnvironment pulsar = new
PulsarTestEnvironment(PulsarRuntime.container());
@TestSemantics
CheckpointingMode[] semantics = new CheckpointingMode[]
{CheckpointingMode.EXACTLY_ONCE};
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/PulsarTestSuiteBase.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/PulsarTestSuiteBase.java
index 6f64ec0..567ccd3 100644
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/PulsarTestSuiteBase.java
+++
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/PulsarTestSuiteBase.java
@@ -55,7 +55,7 @@ public abstract class PulsarTestSuiteBase {
* pulsar broker. Override this method when needs.
*/
protected PulsarRuntime runtime() {
- return PulsarRuntime.mock();
+ return PulsarRuntime.container();
}
/** Operate pulsar by acquiring a runtime operator. */
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/PulsarRuntime.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/PulsarRuntime.java
index 6beb94a..641b924 100644
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/PulsarRuntime.java
+++
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/PulsarRuntime.java
@@ -20,7 +20,6 @@ package org.apache.flink.connector.pulsar.testutils.runtime;
import org.apache.flink.connector.pulsar.testutils.PulsarTestEnvironment;
import
org.apache.flink.connector.pulsar.testutils.runtime.container.PulsarContainerRuntime;
-import
org.apache.flink.connector.pulsar.testutils.runtime.mock.PulsarMockRuntime;
import org.testcontainers.containers.GenericContainer;
@@ -44,16 +43,10 @@ public interface PulsarRuntime {
*/
PulsarRuntimeOperator operator();
- /** Create a Pulsar instance which would mock all the backends. */
- static PulsarRuntime mock() {
- return new PulsarMockRuntime();
- }
-
/**
* Create a Pulsar instance in docker. We would start a standalone Pulsar
in TestContainers.
- * This runtime is often used in end-to-end tests. The performance may be
a bit of slower than
- * {@link #mock()}. The stream storage for bookkeeper is disabled. The
function worker is
- * disabled on Pulsar broker.
+ * This runtime is often used in end-to-end tests. The stream storage for
bookkeeper is
+ * disabled. The function worker is disabled on Pulsar broker.
*/
static PulsarRuntime container() {
return new PulsarContainerRuntime();
@@ -61,9 +54,8 @@ public interface PulsarRuntime {
/**
* Create a Pulsar instance in docker. We would start a standalone Pulsar
in TestContainers.
- * This runtime is often used in end-to-end tests. The performance may be
a bit of slower than
- * {@link #mock()}. The stream storage for bookkeeper is disabled. The
function worker is
- * disabled on Pulsar broker.
+ * This runtime is often used in end-to-end tests. The stream storage for
bookkeeper is
+ * disabled. The function worker is disabled on Pulsar broker.
*
* <p>We would link the created Pulsar docker instance with the given
flink instance. This would
* enable the connection for Pulsar and Flink in docker environment.
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/PulsarRuntimeUtils.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/PulsarRuntimeUtils.java
deleted file mode 100644
index c2c2e6b..0000000
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/PulsarRuntimeUtils.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.connector.pulsar.testutils.runtime;
-
-import org.apache.pulsar.broker.ServiceConfiguration;
-import org.apache.pulsar.client.admin.PulsarAdmin;
-import org.apache.pulsar.client.admin.PulsarAdminException;
-import org.apache.pulsar.client.api.PulsarClientException;
-import org.apache.pulsar.common.naming.TopicName;
-import org.apache.pulsar.common.policies.data.ClusterData;
-import org.apache.pulsar.common.policies.data.TenantInfo;
-import org.apache.pulsar.common.policies.data.TenantInfoImpl;
-
-import java.util.Collections;
-import java.util.List;
-
-import static org.apache.pulsar.common.naming.NamespaceName.SYSTEM_NAMESPACE;
-import static
org.apache.pulsar.common.naming.TopicName.TRANSACTION_COORDINATOR_ASSIGN;
-
-/** This class is used to create the basic topics for a standalone Pulsar
instance. */
-public final class PulsarRuntimeUtils {
-
- private PulsarRuntimeUtils() {
- // No public constructor
- }
-
- /** Create the system topics. */
- public static void initializePulsarEnvironment(
- ServiceConfiguration config, String serviceUrl, String adminUrl)
- throws PulsarAdminException, PulsarClientException {
- try (PulsarAdmin admin =
PulsarAdmin.builder().serviceHttpUrl(adminUrl).build()) {
- ClusterData clusterData =
-
ClusterData.builder().serviceUrl(adminUrl).brokerServiceUrl(serviceUrl).build();
- String cluster = config.getClusterName();
- createSampleNameSpace(admin, clusterData, cluster);
-
- // Create default namespace
- createNameSpace(
- admin,
- cluster,
- TopicName.PUBLIC_TENANT,
- TopicName.PUBLIC_TENANT + "/" +
TopicName.DEFAULT_NAMESPACE);
-
- // Create Pulsar system namespace
- createNameSpace(
- admin, cluster, SYSTEM_NAMESPACE.getTenant(),
SYSTEM_NAMESPACE.toString());
- // Enable transaction
- if (config.isTransactionCoordinatorEnabled()
- && !admin.namespaces()
- .getTopics(SYSTEM_NAMESPACE.toString())
-
.contains(TRANSACTION_COORDINATOR_ASSIGN.getPartition(0).toString())) {
-
admin.topics().createPartitionedTopic(TRANSACTION_COORDINATOR_ASSIGN.toString(),
1);
- }
- }
- }
-
- private static void createSampleNameSpace(
- PulsarAdmin admin, ClusterData clusterData, String cluster)
- throws PulsarAdminException {
- // Create a sample namespace
- String tenant = "sample";
- String globalCluster = "global";
- String namespace = tenant + "/ns1";
-
- List<String> clusters = admin.clusters().getClusters();
- if (!clusters.contains(cluster)) {
- admin.clusters().createCluster(cluster, clusterData);
- } else {
- admin.clusters().updateCluster(cluster, clusterData);
- }
- // Create marker for "global" cluster
- if (!clusters.contains(globalCluster)) {
- admin.clusters().createCluster(globalCluster,
ClusterData.builder().build());
- }
-
- if (!admin.tenants().getTenants().contains(tenant)) {
- admin.tenants()
- .createTenant(
- tenant,
- new TenantInfoImpl(
- Collections.emptySet(),
Collections.singleton(cluster)));
- }
-
- if (!admin.namespaces().getNamespaces(tenant).contains(namespace)) {
- admin.namespaces().createNamespace(namespace);
- }
- }
-
- private static void createNameSpace(
- PulsarAdmin admin, String cluster, String publicTenant, String
defaultNamespace)
- throws PulsarAdminException {
- if (!admin.tenants().getTenants().contains(publicTenant)) {
- admin.tenants()
- .createTenant(
- publicTenant,
- TenantInfo.builder()
- .adminRoles(Collections.emptySet())
-
.allowedClusters(Collections.singleton(cluster))
- .build());
- }
- if
(!admin.namespaces().getNamespaces(publicTenant).contains(defaultNamespace)) {
- admin.namespaces().createNamespace(defaultNamespace);
- admin.namespaces()
- .setNamespaceReplicationClusters(
- defaultNamespace, Collections.singleton(cluster));
- }
- }
-}
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/container/PulsarContainerRuntime.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/container/PulsarContainerRuntime.java
index eac42f0..4032d0b 100644
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/container/PulsarContainerRuntime.java
+++
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/container/PulsarContainerRuntime.java
@@ -20,7 +20,6 @@ package
org.apache.flink.connector.pulsar.testutils.runtime.container;
import org.apache.flink.connector.pulsar.testutils.runtime.PulsarRuntime;
import
org.apache.flink.connector.pulsar.testutils.runtime.PulsarRuntimeOperator;
-import org.apache.flink.util.DockerImageVersions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -32,7 +31,6 @@ import org.testcontainers.utility.DockerImageName;
import java.time.Duration;
import java.util.concurrent.atomic.AtomicBoolean;
-import static org.apache.flink.util.DockerImageVersions.PULSAR;
import static org.apache.flink.util.Preconditions.checkArgument;
import static org.apache.flink.util.Preconditions.checkNotNull;
import static org.testcontainers.containers.PulsarContainer.BROKER_HTTP_PORT;
@@ -54,12 +52,11 @@ public class PulsarContainerRuntime implements
PulsarRuntime {
// This url is used on the container side.
private static final String PULSAR_ADMIN_URL =
String.format("http://%s:%d", PULSAR_INTERNAL_HOSTNAME,
BROKER_HTTP_PORT);
+ private static final DockerImageName PULSAR_IMAGE =
+ DockerImageName.parse("apachepulsar/pulsar:2.10.2");
- /**
- * Create a pulsar container provider by a predefined version, this
constance {@link
- * DockerImageVersions#PULSAR} should be bumped after the new pulsar
release.
- */
- private final PulsarContainer container = new
PulsarContainer(DockerImageName.parse(PULSAR));
+ /** Create a pulsar container provider by a predefined version. */
+ private final PulsarContainer container = new
PulsarContainer(PULSAR_IMAGE);
private final AtomicBoolean started = new AtomicBoolean(false);
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/BlankBrokerInterceptor.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/BlankBrokerInterceptor.java
deleted file mode 100644
index 8355a23..0000000
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/BlankBrokerInterceptor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.connector.pulsar.testutils.runtime.mock;
-
-import org.apache.pulsar.broker.PulsarService;
-import org.apache.pulsar.broker.intercept.BrokerInterceptor;
-import org.apache.pulsar.broker.service.ServerCnx;
-import org.apache.pulsar.common.api.proto.BaseCommand;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-/** No operation for this BrokerInterceptor implementation. */
-public class BlankBrokerInterceptor implements BrokerInterceptor {
-
- @Override
- public void onPulsarCommand(BaseCommand command, ServerCnx cnx) {
- // no-op
- }
-
- @Override
- public void onConnectionClosed(ServerCnx cnx) {
- // no-op
- }
-
- @Override
- public void onWebserviceRequest(ServletRequest request) {
- // no-op
- }
-
- @Override
- public void onWebserviceResponse(ServletRequest request, ServletResponse
response) {
- // no-op
- }
-
- @Override
- public void initialize(PulsarService pulsarService) {
- // no-op
- }
-
- @Override
- public void close() {
- // no-op
- }
-}
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/MockBookKeeperClientFactory.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/MockBookKeeperClientFactory.java
deleted file mode 100644
index d35bd66..0000000
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/MockBookKeeperClientFactory.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.connector.pulsar.testutils.runtime.mock;
-
-import io.netty.channel.EventLoopGroup;
-import org.apache.bookkeeper.client.BookKeeper;
-import org.apache.bookkeeper.client.EnsemblePlacementPolicy;
-import org.apache.bookkeeper.common.util.OrderedExecutor;
-import org.apache.bookkeeper.stats.StatsLogger;
-import org.apache.pulsar.broker.BookKeeperClientFactory;
-import org.apache.pulsar.broker.ServiceConfiguration;
-import org.apache.pulsar.metadata.api.extended.MetadataStoreExtended;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.Optional;
-
-/** A BookKeeperClientFactory implementation which returns a mocked
bookkeeper. */
-public class MockBookKeeperClientFactory implements BookKeeperClientFactory {
-
- private final OrderedExecutor executor =
-
OrderedExecutor.newBuilder().numThreads(1).name("mock-pulsar-bookkeeper").build();
-
- private final BookKeeper bookKeeper =
NonClosableMockBookKeeper.create(executor);
-
- @Override
- public BookKeeper create(
- ServiceConfiguration conf,
- MetadataStoreExtended store,
- EventLoopGroup eventLoopGroup,
- Optional<Class<? extends EnsemblePlacementPolicy>>
ensemblePlacementPolicyClass,
- Map<String, Object> ensemblePlacementPolicyProperties)
- throws IOException {
- return bookKeeper;
- }
-
- @Override
- public BookKeeper create(
- ServiceConfiguration conf,
- MetadataStoreExtended store,
- EventLoopGroup eventLoopGroup,
- Optional<Class<? extends EnsemblePlacementPolicy>>
ensemblePlacementPolicyClass,
- Map<String, Object> ensemblePlacementPolicyProperties,
- StatsLogger statsLogger)
- throws IOException {
- return bookKeeper;
- }
-
- @Override
- public void close() {
- try {
- bookKeeper.close();
- executor.shutdown();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/MockPulsarService.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/MockPulsarService.java
deleted file mode 100644
index 09015a7..0000000
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/MockPulsarService.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.connector.pulsar.testutils.runtime.mock;
-
-import org.apache.bookkeeper.common.util.OrderedExecutor;
-import org.apache.pulsar.broker.BookKeeperClientFactory;
-import org.apache.pulsar.broker.PulsarService;
-import org.apache.pulsar.broker.ServiceConfiguration;
-import org.apache.pulsar.broker.intercept.BrokerInterceptor;
-import org.apache.pulsar.broker.namespace.NamespaceService;
-
-import java.util.function.Supplier;
-
-/** A Mock pulsar service which would use the mocked zookeeper and bookkeeper.
*/
-public class MockPulsarService extends PulsarService {
-
- private final SameThreadOrderedSafeExecutor orderedExecutor =
- new SameThreadOrderedSafeExecutor();
-
- public MockPulsarService(ServiceConfiguration config) {
- super(config);
- }
-
- public BookKeeperClientFactory newBookKeeperClientFactory() {
- return new MockBookKeeperClientFactory();
- }
-
- public Supplier<NamespaceService> getNamespaceServiceProvider() {
- return () -> new NamespaceService(this);
- }
-
- @Override
- public OrderedExecutor getOrderedExecutor() {
- return orderedExecutor;
- }
-
- @Override
- public BrokerInterceptor getBrokerInterceptor() {
- return new BlankBrokerInterceptor();
- }
-}
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/NonClosableMockBookKeeper.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/NonClosableMockBookKeeper.java
deleted file mode 100644
index b7001b8..0000000
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/NonClosableMockBookKeeper.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.connector.pulsar.testutils.runtime.mock;
-
-import org.apache.bookkeeper.client.BookKeeper;
-import org.apache.bookkeeper.client.PulsarMockBookKeeper;
-import org.apache.bookkeeper.common.util.OrderedExecutor;
-
-/**
- * Prevent the MockBookKeeper instance from being closed when the broker is
restarted within a test.
- */
-public class NonClosableMockBookKeeper extends PulsarMockBookKeeper {
-
- private NonClosableMockBookKeeper(OrderedExecutor executor) throws
Exception {
- super(executor);
- }
-
- @Override
- public void close() {
- // no-op
- }
-
- @Override
- public void shutdown() {
- // no-op
- }
-
- public void reallyShutdown() {
- super.shutdown();
- }
-
- public static BookKeeper create(OrderedExecutor executor) {
- try {
- return new NonClosableMockBookKeeper(executor);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/PulsarMockRuntime.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/PulsarMockRuntime.java
deleted file mode 100644
index b0df4c5..0000000
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/PulsarMockRuntime.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.connector.pulsar.testutils.runtime.mock;
-
-import org.apache.flink.connector.pulsar.testutils.runtime.PulsarRuntime;
-import
org.apache.flink.connector.pulsar.testutils.runtime.PulsarRuntimeOperator;
-
-import org.apache.pulsar.broker.ServiceConfiguration;
-
-import java.util.Optional;
-
-import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
-import static
org.apache.flink.connector.pulsar.testutils.runtime.PulsarRuntimeUtils.initializePulsarEnvironment;
-import static org.apache.flink.util.Preconditions.checkNotNull;
-
-/** Providing a mocked pulsar server. */
-public class PulsarMockRuntime implements PulsarRuntime {
-
- private static final String CLUSTER_NAME = "mock-pulsar-" +
randomAlphanumeric(6);
- private final ServiceConfiguration configuration;
- private final MockPulsarService pulsarService;
- private PulsarRuntimeOperator operator;
-
- public PulsarMockRuntime() {
- this(createConfig());
- }
-
- public PulsarMockRuntime(ServiceConfiguration configuration) {
- this.configuration = configuration;
- this.pulsarService = new MockPulsarService(configuration);
- }
-
- @Override
- public void startUp() {
- try {
- pulsarService.start();
-
- String serviceUrl = pulsarService.getBrokerServiceUrl();
- String adminUrl = pulsarService.getWebServiceAddress();
- initializePulsarEnvironment(configuration, serviceUrl, adminUrl);
-
- this.operator = new PulsarRuntimeOperator(serviceUrl, adminUrl);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- @Override
- public void tearDown() {
- try {
- if (operator != null) {
- operator.close();
- }
- pulsarService.close();
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- @Override
- public PulsarRuntimeOperator operator() {
- return checkNotNull(operator, "You should start this mock pulsar
first.");
- }
-
- private static ServiceConfiguration createConfig() {
- ServiceConfiguration configuration = new ServiceConfiguration();
-
- configuration.setAdvertisedAddress("localhost");
- configuration.setClusterName(CLUSTER_NAME);
-
- configuration.setManagedLedgerCacheSizeMB(8);
- configuration.setActiveConsumerFailoverDelayTimeMillis(0);
- configuration.setDefaultRetentionTimeInMinutes(7);
- configuration.setDefaultNumberOfNamespaceBundles(1);
- configuration.setMetadataStoreUrl("memory:local");
- configuration.setConfigurationMetadataStoreUrl("memory:local");
-
- configuration.setAuthenticationEnabled(false);
- configuration.setAuthorizationEnabled(false);
- configuration.setAllowAutoTopicCreation(true);
- configuration.setBrokerDeleteInactiveTopicsEnabled(false);
- configuration.setTopicLevelPoliciesEnabled(true);
- configuration.setWebSocketServiceEnabled(false);
- // Use runtime dynamic ports
- configuration.setBrokerServicePort(Optional.of(0));
- configuration.setWebServicePort(Optional.of(0));
-
- // Enable transactions.
- configuration.setSystemTopicEnabled(true);
- configuration.setBrokerDeduplicationEnabled(true);
- configuration.setTransactionCoordinatorEnabled(true);
- configuration.setTransactionMetadataStoreProviderClassName(
-
"org.apache.pulsar.transaction.coordinator.impl.MLTransactionMetadataStoreProvider");
- configuration.setDefaultNumberOfNamespaceBundles(1);
-
- return configuration;
- }
-}
diff --git
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/SameThreadOrderedSafeExecutor.java
b/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/SameThreadOrderedSafeExecutor.java
deleted file mode 100644
index 9667f08..0000000
---
a/flink-connector-pulsar/src/test/java/org/apache/flink/connector/pulsar/testutils/runtime/mock/SameThreadOrderedSafeExecutor.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.connector.pulsar.testutils.runtime.mock;
-
-import org.apache.bookkeeper.common.util.OrderedExecutor;
-import org.apache.bookkeeper.common.util.SafeRunnable;
-import org.apache.bookkeeper.stats.NullStatsLogger;
-import org.apache.pulsar.shade.io.netty.util.concurrent.DefaultThreadFactory;
-
-/** Override the default bookkeeper executor for executing in one thread
executor. */
-public class SameThreadOrderedSafeExecutor extends OrderedExecutor {
-
- public SameThreadOrderedSafeExecutor() {
- super(
- "same-thread-executor",
- 1,
- new DefaultThreadFactory("test"),
- NullStatsLogger.INSTANCE,
- false,
- false,
- 100000,
- -1,
- false);
- }
-
- @Override
- public void execute(Runnable r) {
- r.run();
- }
-
- @Override
- public void executeOrdered(int orderingKey, SafeRunnable r) {
- r.run();
- }
-
- @Override
- public void executeOrdered(long orderingKey, SafeRunnable r) {
- r.run();
- }
-}
diff --git a/flink-sql-connector-pulsar/pom.xml
b/flink-sql-connector-pulsar/pom.xml
index 87f46e4..bec9d3d 100644
--- a/flink-sql-connector-pulsar/pom.xml
+++ b/flink-sql-connector-pulsar/pom.xml
@@ -30,7 +30,7 @@ under the License.
</parent>
<artifactId>flink-sql-connector-pulsar</artifactId>
- <name>Flink : Connectors : SQL : Pulsar</name>
+ <name>Flink : Connectors : Pulsar : SQL</name>
<packaging>jar</packaging>
diff --git a/pom.xml b/pom.xml
index 865e86a..5e7bc52 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,9 @@ regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
+
http://www.apache.org/licenses/LICENSE-2.0
+
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,14 +21,14 @@ under the License.
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>io.github.zentol.flink</groupId>
<artifactId>flink-connector-parent</artifactId>
<version>1.0</version>
</parent>
- <modelVersion>4.0.0</modelVersion>
-
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-pulsar-parent</artifactId>
<version>4.0-SNAPSHOT</version>
@@ -51,25 +53,31 @@ under the License.
<properties>
<flink.version>1.17-SNAPSHOT</flink.version>
<pulsar.version>2.10.2</pulsar.version>
-
- <jackson-bom.version>2.13.4.20221013</jackson-bom.version>
- <grpc-bom.version>1.45.1</grpc-bom.version>
<bouncycastle.version>1.69</bouncycastle.version>
- <google.auth.version>1.4.0</google.auth.version>
- <jetty.version>9.4.48.v20220622</jetty.version>
- <simpleclient.version>0.8.1</simpleclient.version>
- <junit4.version>4.13.2</junit4.version>
+
+ <jsr305.version>1.3.9</jsr305.version>
<junit5.version>5.9.1</junit5.version>
+ <junit5-platform.version>1.9.1</junit5-platform.version>
<assertj.version>3.23.1</assertj.version>
- <archunit.version>1.0.0</archunit.version>
- <testcontainers.version>1.17.2</testcontainers.version>
- <mockito.version>2.21.0</mockito.version>
+ <mockito.version>4.11.0</mockito.version>
+ <archunit.version>1.0.1</archunit.version>
+ <testcontainers.version>1.17.6</testcontainers.version>
<japicmp.skip>false</japicmp.skip>
<japicmp.referenceVersion>1.16.0</japicmp.referenceVersion>
+ <protobuf.version>3.21.9</protobuf.version>
<slf4j.version>1.7.36</slf4j.version>
<log4j.version>2.17.2</log4j.version>
+ <jaxb-api.version>2.3.1</jaxb-api.version>
+ <commons-compress.version>1.22</commons-compress.version>
+ <byte-buddy.version>1.12.20</byte-buddy.version>
+ <kryo.version>2.24.0</kryo.version>
+ <objenesis.version>3.3</objenesis.version>
+
+ <os-maven-plugin.version>1.7.0</os-maven-plugin.version>
+ <protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
+
<build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
<flink.parent.artifactId>flink-connector-pulsar-parent</flink.parent.artifactId>
</properties>
@@ -78,6 +86,7 @@ under the License.
<!-- Root dependencies for all projects -->
<!-- Logging API -->
+
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
@@ -85,6 +94,7 @@ under the License.
</dependency>
<!-- 'javax.annotation' classes like '@Nullable' -->
+
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
@@ -92,25 +102,22 @@ under the License.
</dependency>
<!-- Test dependencies -->
+
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
- <version>${junit5.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
- <version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>${mockito.version}</version>
- <type>jar</type>
<scope>test</scope>
</dependency>
@@ -147,86 +154,122 @@ under the License.
</dependency>
<!-- ArchUit test dependencies -->
+
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-architecture-tests-test</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-architecture-tests-production</artifactId>
<scope>test</scope>
</dependency>
-
</dependencies>
<!-- This section defines the module versions that are used if nothing
else is specified. -->
<dependencyManagement>
-
<dependencies>
+ <dependency>
+ <groupId>org.apache.pulsar</groupId>
+ <artifactId>pulsar-client-all</artifactId>
+ <version>${pulsar.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.sun.activation</groupId>
+ <artifactId>javax.activation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jakarta.activation</groupId>
+ <artifactId>jakarta.activation-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>net.jcip</groupId>
+ <artifactId>jcip-annotations</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.pulsar</groupId>
+ <artifactId>pulsar-package-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.beust</groupId>
+ <artifactId>jcommander</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
<!-- Flink dependencies -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils</artifactId>
<version>${flink.version}</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils-junit</artifactId>
<version>${flink.version}</version>
- <scope>test</scope>
</dependency>
- <!-- Flink ArchUnit -->
-
<dependency>
<groupId>org.apache.flink</groupId>
- <artifactId>flink-architecture-tests-base</artifactId>
+ <artifactId>flink-connector-test-utils</artifactId>
<version>${flink.version}</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
- <artifactId>flink-architecture-tests-test</artifactId>
+ <artifactId>flink-core</artifactId>
<version>${flink.version}</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
- <artifactId>flink-architecture-tests-production</artifactId>
+ <artifactId>flink-streaming-java</artifactId>
<version>${flink.version}</version>
- <scope>test</scope>
</dependency>
- <!-- This manages the 'javax.annotation' annotations (JSR305) -->
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- <version>1.3.9</version>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-connector-base</artifactId>
+ <version>${flink.version}</version>
</dependency>
+ <!-- Flink ArchUnit -->
+
<dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.15</version>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-architecture-tests-test</artifactId>
+ <version>${flink.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- <version>4.4.14</version>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-architecture-tests-production</artifactId>
+ <version>${flink.version}</version>
</dependency>
+ <!-- This manages the 'javax.annotation' annotations (JSR305) -->
+
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>4.5.13</version>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <version>${jsr305.version}</version>
</dependency>
<dependency>
@@ -268,364 +311,112 @@ under the License.
<scope>import</scope>
</dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <version>${assertj.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>${mockito.version}</version>
+ </dependency>
+
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit</artifactId>
<version>${archunit.version}</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5</artifactId>
<version>${archunit.version}</version>
- <scope>test</scope>
</dependency>
<!-- For dependency convergence -->
+
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-engine</artifactId>
- <version>1.8.1</version>
+ <version>${junit5-platform.version}</version>
</dependency>
<!-- For dependency convergence -->
- <dependency>
- <groupId>com.esotericsoftware.kryo</groupId>
- <artifactId>kryo</artifactId>
- <version>2.24.0</version>
- </dependency>
-
- <!-- For dependency convergence -->
- <dependency>
- <groupId>org.objenesis</groupId>
- <artifactId>objenesis</artifactId>
- <version>2.6</version>
- </dependency>
-
- <!-- For dependency convergence -->
- <dependency>
- <groupId>net.bytebuddy</groupId>
- <artifactId>byte-buddy</artifactId>
- <version>1.12.10</version>
- </dependency>
- <!-- For dependency convergence -->
<dependency>
<groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-api</artifactId>
+ <artifactId>junit-jupiter</artifactId>
<version>${junit5.version}</version>
</dependency>
<!-- For dependency convergence -->
- <dependency>
- <groupId>org.junit.platform</groupId>
- <artifactId>junit-platform-commons</artifactId>
- <version>1.9.1</version>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>org.checkerframework</groupId>
- <artifactId>checker-qual</artifactId>
- <version>3.10.0</version>
- <scope>test</scope>
- </dependency>
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java</artifactId>
- <version>${protoc.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java-util</artifactId>
- <version>${protoc.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>31.0.1-jre</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For dependency convergence -->
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>1.5.0</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-collections4</artifactId>
- <version>4.4</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.8.0</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.2</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For dependency convergence -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
- <version>1.21</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>net.java.dev.jna</groupId>
- <artifactId>jna</artifactId>
- <version>5.8.0</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>org.javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>3.25.0-GA</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>org.xerial.snappy</groupId>
- <artifactId>snappy-java</artifactId>
- <version>1.1.8.3</version>
- <scope>test</scope>
+ <version>${commons-compress.version}</version>
</dependency>
<!-- For dependency convergence -->
- <dependency>
- <groupId>com.fasterxml.jackson</groupId>
- <artifactId>jackson-bom</artifactId>
- <type>pom</type>
- <scope>import</scope>
- <version>${jackson-bom.version}</version>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>3.11</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>org.conscrypt</groupId>
- <artifactId>conscrypt-openjdk-uber</artifactId>
- <version>2.5.2</version>
- <scope>test</scope>
- </dependency>
- <!-- For test dependency convergence -->
<dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.8.9</version>
+ <groupId>net.bytebuddy</groupId>
+ <artifactId>byte-buddy</artifactId>
+ <version>${byte-buddy.version}</version>
</dependency>
<!-- For dependency convergence -->
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-ext-jdk15on</artifactId>
- <version>${bouncycastle.version}</version>
- <scope>compile</scope>
- </dependency>
- <!-- For dependency convergence -->
<dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcpkix-jdk15on</artifactId>
- <version>${bouncycastle.version}</version>
- <scope>compile</scope>
+ <groupId>com.esotericsoftware.kryo</groupId>
+ <artifactId>kryo</artifactId>
+ <version>${kryo.version}</version>
</dependency>
<!-- For dependency convergence -->
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-bom</artifactId>
- <type>pom</type>
- <scope>import</scope>
- <version>${grpc-bom.version}</version>
- </dependency>
- <!-- For test dependency convergence -->
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>com.google.auth</groupId>
- <artifactId>google-auth-library-credentials</artifactId>
- <version>${google.auth.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>com.google.auth</groupId>
- <artifactId>google-auth-library-oauth2-http</artifactId>
- <version>${google.auth.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>com.google.http-client</groupId>
- <artifactId>google-http-client</artifactId>
- <version>1.41.0</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>io.perfmark</groupId>
- <artifactId>perfmark-api</artifactId>
- <version>0.19.0</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>io.prometheus</groupId>
- <artifactId>simpleclient_httpserver</artifactId>
- <version>${simpleclient.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>io.prometheus</groupId>
- <artifactId>simpleclient_hotspot</artifactId>
- <version>${simpleclient.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>io.prometheus</groupId>
- <artifactId>simpleclient</artifactId>
- <version>${simpleclient.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>io.prometheus</groupId>
- <artifactId>simpleclient_common</artifactId>
- <version>${simpleclient.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>com.github.ben-manes.caffeine</groupId>
- <artifactId>caffeine</artifactId>
- <version>2.9.1</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- <version>1.33</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit4.version}</version>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- <version>3.6.3</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>net.bytebuddy</groupId>
- <artifactId>byte-buddy-agent</artifactId>
- <version>1.10.14</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>com.google.auto.value</groupId>
- <artifactId>auto-value-annotations</artifactId>
- <version>1.9</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For test dependency convergence -->
- <dependency>
- <groupId>com.google.errorprone</groupId>
- <artifactId>error_prone_annotations</artifactId>
- <version>2.7.1</version>
- <scope>test</scope>
+ <groupId>org.objenesis</groupId>
+ <artifactId>objenesis</artifactId>
+ <version>${objenesis.version}</version>
</dependency>
- <!-- For test dependency convergence -->
<dependency>
- <groupId>io.opencensus</groupId>
- <artifactId>opencensus-contrib-http-util</artifactId>
- <version>0.28.0</version>
- <scope>test</scope>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <version>${protobuf.version}</version>
</dependency>
-
</dependencies>
</dependencyManagement>
<build>
- <plugins>
+ <extensions>
+ <extension>
+ <groupId>kr.motd.maven</groupId>
+ <artifactId>os-maven-plugin</artifactId>
+ <version>${os-maven-plugin.version}</version>
+ </extension>
+ </extensions>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.xolstice.maven.plugins</groupId>
+ <artifactId>protobuf-maven-plugin</artifactId>
+ <version>${protobuf-maven-plugin.version}</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>${build-helper-maven-plugin.version}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
@@ -655,6 +446,7 @@ under the License.
<artifactId>apache-rat-plugin</artifactId>
<inherited>false</inherited>
</plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
@@ -666,10 +458,12 @@ under the License.
</sourceDirectories>
</configuration>
</plugin>
+
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
</plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>