You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "zax1314157 (via GitHub)" <gi...@apache.org> on 2025/02/25 07:53:33 UTC
[PR] [improve] [Aerospike] add support sink connector e2e doc dist [seatunnel]
zax1314157 opened a new pull request, #8821:
URL: https://github.com/apache/seatunnel/pull/8821
A new sink plugin for Aerospike database has been added. It has been modified in accordance with the specifications. I am looking forward to your review and active communication.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] [Aerospike] add support sink connector e2e doc dist [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #8821:
URL: https://github.com/apache/seatunnel/pull/8821#discussion_r2000847157
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-aerospike-e2e/src/test/resources/aerospike_sink_to_console.conf:
##########
@@ -0,0 +1,72 @@
+#
+# 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.
+#
+
+env {
+ parallelism = 1
+ job.mode = BATCH
+
+ #spark config
+ spark.app.name = SeaTunnel
+ spark.executor.instances = 1
+ spark.executor.cores = 1
+ spark.executor.memory = 1g
+ spark.master = local
+}
+
+source {
+ FakeSource {
Review Comment:
how about add test case of read from aerospike and write to aerospike?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] [Aerospike] add support sink connector e2e doc dist [seatunnel]
Posted by "zax1314157 (via GitHub)" <gi...@apache.org>.
zax1314157 commented on code in PR #8821:
URL: https://github.com/apache/seatunnel/pull/8821#discussion_r2010030109
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-aerospike-e2e/src/test/java/org/apache/seatunnel/e2e/connector/aerospike/AbstractAerospikeIT.java:
##########
@@ -0,0 +1,289 @@
+/*
+ * 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.seatunnel.e2e.connector.aerospike;
+
+import org.apache.seatunnel.e2e.common.TestResource;
+import org.apache.seatunnel.e2e.common.TestSuiteBase;
+import org.apache.seatunnel.e2e.common.container.TestContainer;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.TestTemplate;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.utility.DockerImageName;
+import org.testcontainers.utility.DockerLoggerFactory;
+
+import com.aerospike.client.AerospikeClient;
+import com.aerospike.client.Bin;
+import com.aerospike.client.Host;
+import com.aerospike.client.Key;
+import com.aerospike.client.Record;
+import com.aerospike.client.policy.ClientPolicy;
+import com.aerospike.client.policy.ScanPolicy;
+import com.aerospike.client.policy.WritePolicy;
+import com.alibaba.fastjson.JSON;
+
+import java.time.Duration;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public abstract class AbstractAerospikeIT extends TestSuiteBase implements TestResource {
+
+ protected static final String NAMESPACE = "test";
+ protected static final String SET_NAME = "seatunnel";
+ private static final int AEROSPIKE_PORT = 3000;
+ private static final String AEROSPIKE_HOST = "aerospike-host";
+
+ protected AerospikeClient client;
+ protected GenericContainer<?> container;
+
+ @BeforeAll
+ @Override
+ public void startUp() throws Exception {
+ container =
+ new GenericContainer<>(getDockerImage())
+ .withExposedPorts(3000, 3001, 3002, 3003)
+ .withNetworkAliases(AEROSPIKE_HOST)
+ .withNetwork(NETWORK)
+ .withEnv("AEROSPIKE_NAMESPACE", NAMESPACE)
+ .withEnv("AEROSPIKE_MEM_GB", "1")
+ .withEnv("AEROSPIKE_ACCESS_ADDRESS", AEROSPIKE_HOST)
+ .withEnv("AEROSPIKE_ALTERNATE_ACCESS_ADDRESS", AEROSPIKE_HOST)
+ .withLogConsumer(
+ new Slf4jLogConsumer(
+ DockerLoggerFactory.getLogger(getDockerImageName())))
+ .waitingFor(
+ Wait.forLogMessage(".*service ready: soon.*\\n", 1)
+ .withStartupTimeout(Duration.ofMinutes(3)))
+ .withCreateContainerCmdModifier(cmd -> cmd.withHostName(AEROSPIKE_HOST));
+
+ container.start();
+
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+
+ ClientPolicy policy = new ClientPolicy();
+ policy.timeout = 30000;
+ policy.failIfNotConnected = true;
+ policy.readPolicyDefault.maxRetries = 10;
+ policy.writePolicyDefault.maxRetries = 10;
+
+ Host[] hosts =
+ new Host[] {new Host(container.getHost(), container.getMappedPort(AEROSPIKE_PORT))};
+
+ client = new AerospikeClient(policy, hosts);
+
+ // Verify connection
+ if (!client.isConnected()) {
+ throw new IllegalStateException("Failed to connect to Aerospike server");
+ }
+ }
+
+ private void insertTestData() {
+ WritePolicy writePolicy = new WritePolicy();
+ for (int i = 0; i < 100; i++) {
+ Key key = new Key(NAMESPACE, SET_NAME, "seed_" + i);
+ Bin bin1 = new Bin("id", i);
+ Bin bin2 = new Bin("data", "seed-data-" + i);
+ client.put(writePolicy, key, bin1, bin2);
+ }
+ }
+
+ @TestTemplate
+ public void testAerospikeSink(TestContainer container) throws Exception {
+ Container.ExecResult execResult = container.executeJob("/aerospike_sink_to_console.conf");
Review Comment:
Ok, I have changed the file name, Please review it again when you have time
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] [Aerospike] add support sink connector e2e doc dist [seatunnel]
Posted by "zax1314157 (via GitHub)" <gi...@apache.org>.
zax1314157 commented on code in PR #8821:
URL: https://github.com/apache/seatunnel/pull/8821#discussion_r2005825091
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-aerospike-e2e/src/test/resources/aerospike_sink_to_console.conf:
##########
@@ -0,0 +1,72 @@
+#
+# 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.
+#
+
+env {
+ parallelism = 1
+ job.mode = BATCH
+
+ #spark config
+ spark.app.name = SeaTunnel
+ spark.executor.instances = 1
+ spark.executor.cores = 1
+ spark.executor.memory = 1g
+ spark.master = local
+}
+
+source {
+ FakeSource {
Review Comment:
ok, I have added the read and write test case. Could you please review it again
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] [Aerospike] add support sink connector e2e doc dist [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #8821:
URL: https://github.com/apache/seatunnel/pull/8821#discussion_r2009352783
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-aerospike-e2e/src/test/java/org/apache/seatunnel/e2e/connector/aerospike/AbstractAerospikeIT.java:
##########
@@ -0,0 +1,289 @@
+/*
+ * 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.seatunnel.e2e.connector.aerospike;
+
+import org.apache.seatunnel.e2e.common.TestResource;
+import org.apache.seatunnel.e2e.common.TestSuiteBase;
+import org.apache.seatunnel.e2e.common.container.TestContainer;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.TestTemplate;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.utility.DockerImageName;
+import org.testcontainers.utility.DockerLoggerFactory;
+
+import com.aerospike.client.AerospikeClient;
+import com.aerospike.client.Bin;
+import com.aerospike.client.Host;
+import com.aerospike.client.Key;
+import com.aerospike.client.Record;
+import com.aerospike.client.policy.ClientPolicy;
+import com.aerospike.client.policy.ScanPolicy;
+import com.aerospike.client.policy.WritePolicy;
+import com.alibaba.fastjson.JSON;
+
+import java.time.Duration;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public abstract class AbstractAerospikeIT extends TestSuiteBase implements TestResource {
+
+ protected static final String NAMESPACE = "test";
+ protected static final String SET_NAME = "seatunnel";
+ private static final int AEROSPIKE_PORT = 3000;
+ private static final String AEROSPIKE_HOST = "aerospike-host";
+
+ protected AerospikeClient client;
+ protected GenericContainer<?> container;
+
+ @BeforeAll
+ @Override
+ public void startUp() throws Exception {
+ container =
+ new GenericContainer<>(getDockerImage())
+ .withExposedPorts(3000, 3001, 3002, 3003)
+ .withNetworkAliases(AEROSPIKE_HOST)
+ .withNetwork(NETWORK)
+ .withEnv("AEROSPIKE_NAMESPACE", NAMESPACE)
+ .withEnv("AEROSPIKE_MEM_GB", "1")
+ .withEnv("AEROSPIKE_ACCESS_ADDRESS", AEROSPIKE_HOST)
+ .withEnv("AEROSPIKE_ALTERNATE_ACCESS_ADDRESS", AEROSPIKE_HOST)
+ .withLogConsumer(
+ new Slf4jLogConsumer(
+ DockerLoggerFactory.getLogger(getDockerImageName())))
+ .waitingFor(
+ Wait.forLogMessage(".*service ready: soon.*\\n", 1)
+ .withStartupTimeout(Duration.ofMinutes(3)))
+ .withCreateContainerCmdModifier(cmd -> cmd.withHostName(AEROSPIKE_HOST));
+
+ container.start();
+
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+
+ ClientPolicy policy = new ClientPolicy();
+ policy.timeout = 30000;
+ policy.failIfNotConnected = true;
+ policy.readPolicyDefault.maxRetries = 10;
+ policy.writePolicyDefault.maxRetries = 10;
+
+ Host[] hosts =
+ new Host[] {new Host(container.getHost(), container.getMappedPort(AEROSPIKE_PORT))};
+
+ client = new AerospikeClient(policy, hosts);
+
+ // Verify connection
+ if (!client.isConnected()) {
+ throw new IllegalStateException("Failed to connect to Aerospike server");
+ }
+ }
+
+ private void insertTestData() {
+ WritePolicy writePolicy = new WritePolicy();
+ for (int i = 0; i < 100; i++) {
+ Key key = new Key(NAMESPACE, SET_NAME, "seed_" + i);
+ Bin bin1 = new Bin("id", i);
+ Bin bin2 = new Bin("data", "seed-data-" + i);
+ client.put(writePolicy, key, bin1, bin2);
+ }
+ }
+
+ @TestTemplate
+ public void testAerospikeSink(TestContainer container) throws Exception {
+ Container.ExecResult execResult = container.executeJob("/aerospike_sink_to_console.conf");
Review Comment:
```suggestion
Container.ExecResult execResult = container.executeJob("/fake_to_aerospike_sink.conf");
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] [Aerospike] add support sink connector e2e doc dist [seatunnel]
Posted by "corgy-w (via GitHub)" <gi...@apache.org>.
corgy-w commented on PR #8821:
URL: https://github.com/apache/seatunnel/pull/8821#issuecomment-2681097113
good pr,Please follow the [instructions](https://github.com/apache/seatunnel/pull/8821/checks?check_run_id=37765389503) to open ci
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] [Aerospike] add support sink connector e2e doc dist [seatunnel]
Posted by "zax1314157 (via GitHub)" <gi...@apache.org>.
zax1314157 commented on PR #8821:
URL: https://github.com/apache/seatunnel/pull/8821#issuecomment-2709224749
@corgy-w Hello, I have followed the instructions to open CI. Please review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Connector-V2] Add aerospike sink connector [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 merged PR #8821:
URL: https://github.com/apache/seatunnel/pull/8821
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] [Aerospike] add support sink connector e2e doc dist [seatunnel]
Posted by "zax1314157 (via GitHub)" <gi...@apache.org>.
zax1314157 commented on PR #8821:
URL: https://github.com/apache/seatunnel/pull/8821#issuecomment-2720459429
[https://github.com/apache/seatunnel/issues/8822](url)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] [Aerospike] add support sink connector e2e doc dist [seatunnel]
Posted by "zax1314157 (via GitHub)" <gi...@apache.org>.
zax1314157 commented on PR #8821:
URL: https://github.com/apache/seatunnel/pull/8821#issuecomment-2716169401
@WillemJiang Hello, I have followed the instructions to open CI. Do you have time to review my code? Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org