From 7b83ae592ecc551cb4c60af069fbb5086d18e782 Mon Sep 17 00:00:00 2001 From: yangshengjie Date: Thu, 1 Sep 2022 10:20:53 +0800 Subject: [PATCH] [Feature][Connector-V2] Add sentry sink connector: modify pom.xml and doc, remove example class --- docs/en/connector-v2/sink/Sentry.md | 6 ++ pom.xml | 1 + .../connector-sentry/pom.xml | 11 +--- .../pom.xml | 5 -- .../flink/v2/SeaTunnelSentryExample.java | 50 ---------------- .../resources/examples/fake_to_sentry.conf | 59 ------------------- 6 files changed, 9 insertions(+), 123 deletions(-) delete mode 100644 seatunnel-examples/seatunnel-flink-connector-v2-example/src/main/java/org/apache/seatunnel/example/flink/v2/SeaTunnelSentryExample.java delete mode 100644 seatunnel-examples/seatunnel-flink-connector-v2-example/src/main/resources/examples/fake_to_sentry.conf diff --git a/docs/en/connector-v2/sink/Sentry.md b/docs/en/connector-v2/sink/Sentry.md index 1a6241a3203d..1e64e8aaba15 100644 --- a/docs/en/connector-v2/sink/Sentry.md +++ b/docs/en/connector-v2/sink/Sentry.md @@ -4,6 +4,12 @@ Write message to Sentry. +## Key features + +- [ ] [exactly-once](../../concept/connector-v2-features.md) +- [ ] [schema projection](../../concept/connector-v2-features.md) + + ## Options | name | type | required | default value | diff --git a/pom.xml b/pom.xml index 6982068dec67..6e61e5b879f8 100644 --- a/pom.xml +++ b/pom.xml @@ -232,6 +232,7 @@ 4.2.0 4.4.9 2.19.0-public + 5.0.1 diff --git a/seatunnel-connectors-v2/connector-sentry/pom.xml b/seatunnel-connectors-v2/connector-sentry/pom.xml index 4c2c4e051a87..0e3ce8049dd9 100644 --- a/seatunnel-connectors-v2/connector-sentry/pom.xml +++ b/seatunnel-connectors-v2/connector-sentry/pom.xml @@ -35,22 +35,15 @@ seatunnel-api ${project.version} - - - - - - io.sentry sentry-logback - 5.0.1 + ${sentry.version} org.apache.seatunnel connector-common - 2.1.3-SNAPSHOT - compile + ${project.version} diff --git a/seatunnel-examples/seatunnel-flink-connector-v2-example/pom.xml b/seatunnel-examples/seatunnel-flink-connector-v2-example/pom.xml index c90995f24153..d52f99dbdf9a 100644 --- a/seatunnel-examples/seatunnel-flink-connector-v2-example/pom.xml +++ b/seatunnel-examples/seatunnel-flink-connector-v2-example/pom.xml @@ -82,11 +82,6 @@ ${project.version} - - org.apache.seatunnel - connector-sentry - ${project.version} - org.apache.flink diff --git a/seatunnel-examples/seatunnel-flink-connector-v2-example/src/main/java/org/apache/seatunnel/example/flink/v2/SeaTunnelSentryExample.java b/seatunnel-examples/seatunnel-flink-connector-v2-example/src/main/java/org/apache/seatunnel/example/flink/v2/SeaTunnelSentryExample.java deleted file mode 100644 index 7c0b1c5454f6..000000000000 --- a/seatunnel-examples/seatunnel-flink-connector-v2-example/src/main/java/org/apache/seatunnel/example/flink/v2/SeaTunnelSentryExample.java +++ /dev/null @@ -1,50 +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.seatunnel.example.flink.v2; - -import org.apache.seatunnel.core.starter.Seatunnel; -import org.apache.seatunnel.core.starter.command.Command; -import org.apache.seatunnel.core.starter.exception.CommandException; -import org.apache.seatunnel.core.starter.flink.args.FlinkCommandArgs; -import org.apache.seatunnel.core.starter.flink.command.FlinkCommandBuilder; - -import java.io.FileNotFoundException; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.file.Paths; - -public class SeaTunnelSentryExample { - public static void main(String[] args) throws FileNotFoundException, URISyntaxException, CommandException { - String configFile = getTestConfigFile("/examples/fake_to_sentry.conf"); - FlinkCommandArgs flinkCommandArgs = new FlinkCommandArgs(); - flinkCommandArgs.setConfigFile(configFile); - flinkCommandArgs.setCheckConfig(false); - flinkCommandArgs.setVariables(null); - Command flinkCommand = - new FlinkCommandBuilder().buildCommand(flinkCommandArgs); - Seatunnel.run(flinkCommand); - } - - public static String getTestConfigFile(String configFile) throws FileNotFoundException, URISyntaxException { - URL resource = SeaTunnelSentryExample.class.getResource(configFile); - if (resource == null) { - throw new FileNotFoundException("Can't find config file: " + configFile); - } - return Paths.get(resource.toURI()).toString(); - } -} diff --git a/seatunnel-examples/seatunnel-flink-connector-v2-example/src/main/resources/examples/fake_to_sentry.conf b/seatunnel-examples/seatunnel-flink-connector-v2-example/src/main/resources/examples/fake_to_sentry.conf deleted file mode 100644 index be57175e42da..000000000000 --- a/seatunnel-examples/seatunnel-flink-connector-v2-example/src/main/resources/examples/fake_to_sentry.conf +++ /dev/null @@ -1,59 +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. -# -###### -###### This config file is a demonstration of streaming processing in seatunnel config -###### - -env { - # You can set flink configuration here - execution.parallelism = 1 - #job.mode = "BATCH" - #execution.checkpoint.interval = 10000 - #execution.checkpoint.data-uri = "hdfs://localhost:9000/checkpoint" -} - -source { - # This is a example source plugin **only for test and demonstrate the feature source plugin** - FakeSource { - result_table_name = "fake" - field_name = "name,age" - } - - # If you would like to get more information about how to configure seatunnel and see full list of source plugins, - # please go to https://seatunnel.apache.org/docs/flink/configuration/source-plugins/Fake -} - -transform { - sql { - sql = "select name,age from fake" - } - - # If you would like to get more information about how to configure seatunnel and see full list of transform plugins, - # please go to https://seatunnel.apache.org/docs/flink/configuration/transform-plugins/Sql -} - -sink { - Sentry { - dsn = "https://xxx@sentry.xxx.com:9999/6" - enableExternalConfiguration = true - maxCacheItems = 1000 - env = test - } - - # If you would like to get more information about how to configure seatunnel and see full list of sink plugins, - # please go to https://seatunnel.apache.org/docs/flink/configuration/sink-plugins/Console -} \ No newline at end of file