You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/08/13 04:42:15 UTC
[GitHub] [incubator-seatunnel] TyrantLucifer opened a new pull request, #2399: [Feature][Connector-V2] Add base source connector code for connector-file-base
TyrantLucifer opened a new pull request, #2399:
URL: https://github.com/apache/incubator-seatunnel/pull/2399
<!--
Thank you for contributing to SeaTunnel! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
## Contribution Checklist
- Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-seatunnel/issues).
- Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
- Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
-->
## Purpose of this pull request
The base of file source connector
<!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
## Check list
* [x] Code changed are covered with tests, or it does not need tests for reason:
* [ ] If any new Jar binary package adding in your PR, please add License Notice according
[New License Guide](https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/contribution/new-license.md)
* [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-seatunnel/tree/dev/docs
--
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
[GitHub] [incubator-seatunnel] TyrantLucifer commented on a diff in pull request #2399: [Feature][Connector-V2] Add base source connector code for connector-file-base
Posted by GitBox <gi...@apache.org>.
TyrantLucifer commented on code in PR #2399:
URL: https://github.com/apache/incubator-seatunnel/pull/2399#discussion_r945158520
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/AbstractReadStrategy.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * 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.connectors.seatunnel.file.source.reader;
+
+import org.apache.seatunnel.connectors.seatunnel.file.config.HadoopConf;
+import org.apache.seatunnel.connectors.seatunnel.file.exception.FilePluginException;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.CommonConfigurationKeys;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+public abstract class AbstractReadStrategy implements ReadStrategy {
+ HadoopConf hadoopConf;
+
+ @Override
+ public void init(HadoopConf conf) {
+ this.hadoopConf = conf;
+ }
+
+ @Override
+ public Configuration getConfiguration(HadoopConf hadoopConf) {
Review Comment:
> I guess the `S3 File Source` and `OSS File Source` will extend this class too. Does the `Configuration` can use for read `S3 File` and `OSS File`?
As the current orc and parquet are based on hadoop system products, the official api only provides a read interface based on hadoop file system, if we want to interface with oss or s3, currently only supports reading text files, as far as I know, oss and s3 can also support the hdfs protocol file interface, so I think this method will be used in the future.
For the moment, if you want to read orc or parquet files on top of oss or s3, I can think of two options.
1. download the oss or s3 file locally and read it through the local interface, which is not an elegant solution, but a fast and effective one
2. encapsulate the file stream returned by s3 or oss based on the api of parquet or orc, and disguise it as a hadoop file, which is more elegant, but needs time for research and verification
--
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
[GitHub] [incubator-seatunnel] TyrantLucifer commented on a diff in pull request #2399: [Feature][Connector-V2] Add base source connector code for connector-file-base
Posted by GitBox <gi...@apache.org>.
TyrantLucifer commented on code in PR #2399:
URL: https://github.com/apache/incubator-seatunnel/pull/2399#discussion_r945158727
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/BaseFileSourceReader.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * 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.connectors.seatunnel.file.source;
+
+import org.apache.seatunnel.api.source.Collector;
+import org.apache.seatunnel.api.source.SourceReader;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.connectors.seatunnel.file.config.HadoopConf;
+import org.apache.seatunnel.connectors.seatunnel.file.source.reader.ReadStrategy;
+import org.apache.seatunnel.connectors.seatunnel.file.source.split.FileSourceSplit;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class BaseFileSourceReader implements SourceReader<SeaTunnelRow, FileSourceSplit> {
+ private static final long THREAD_WAIT_TIME = 500L;
+ private final ReadStrategy readStrategy;
+ private final HadoopConf hadoopConf;
+ private final SourceReader.Context context;
+ private final Set<FileSourceSplit> sourceSplits;
+
+ public BaseFileSourceReader(ReadStrategy readStrategy, HadoopConf hadoopConf, SourceReader.Context context) {
+ this.readStrategy = readStrategy;
+ this.hadoopConf = hadoopConf;
+ this.context = context;
+ this.sourceSplits = new HashSet<>();
+ }
+
+ @Override
+ public void open() throws Exception {
+ readStrategy.init(hadoopConf);
+ }
+
+ @Override
+ public void close() throws IOException {
+
+ }
+
+ @Override
+ public void pollNext(Collector<SeaTunnelRow> output) throws Exception {
+ if (sourceSplits.isEmpty()) {
+ Thread.sleep(THREAD_WAIT_TIME);
+ return;
+ }
+ sourceSplits.forEach(source -> {
+ try {
+ readStrategy.read(source.splitId(), output);
+ } catch (Exception e) {
+ throw new RuntimeException("File source read error", e);
+ }
+ });
+ context.signalNoMoreElement();
Review Comment:
I think the preview version only supports offline first, and then continue to upgrade to support streaming model.
--
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
[GitHub] [incubator-seatunnel] TyrantLucifer commented on a diff in pull request #2399: [Feature][Connector-V2] Add base source connector code for connector-file-base
Posted by GitBox <gi...@apache.org>.
TyrantLucifer commented on code in PR #2399:
URL: https://github.com/apache/incubator-seatunnel/pull/2399#discussion_r945708216
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/ReadStrategyFactory.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.connectors.seatunnel.file.source.reader;
+
+import org.apache.seatunnel.connectors.seatunnel.file.config.FileFormat;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class ReadStrategyFactory {
+
+ private ReadStrategyFactory() {}
+
+ public static ReadStrategy of(String fileType) {
+ try {
+ FileFormat fileFormat = FileFormat.valueOf(fileType.toUpperCase());
+ return fileFormat.getReadStrategy();
+ } catch (IllegalArgumentException e) {
+ log.warn("File source connector not support this file type [{}], it will be treated as a plain text file", fileType);
+ return new TextReadStrategy();
+ }
+ }
Review Comment:
Resolved, pls 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
[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #2399: [Feature][Connector-V2] Add base source connector code for connector-file-base
Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on code in PR #2399:
URL: https://github.com/apache/incubator-seatunnel/pull/2399#discussion_r945411675
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/ReadStrategyFactory.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.connectors.seatunnel.file.source.reader;
+
+import org.apache.seatunnel.connectors.seatunnel.file.config.FileFormat;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class ReadStrategyFactory {
+
+ private ReadStrategyFactory() {}
+
+ public static ReadStrategy of(String fileType) {
+ try {
+ FileFormat fileFormat = FileFormat.valueOf(fileType.toUpperCase());
+ return fileFormat.getReadStrategy();
+ } catch (IllegalArgumentException e) {
+ log.warn("File source connector not support this file type [{}], it will be treated as a plain text file", fileType);
+ return new TextReadStrategy();
+ }
+ }
Review Comment:
When the user has no configuration we use the default txt, when the user has configuration but we do not support it should throw an error
--
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
[GitHub] [incubator-seatunnel] EricJoy2048 commented on a diff in pull request #2399: [Feature][Connector-V2] Add base source connector code for connector-file-base
Posted by GitBox <gi...@apache.org>.
EricJoy2048 commented on code in PR #2399:
URL: https://github.com/apache/incubator-seatunnel/pull/2399#discussion_r945251135
##########
seatunnel-connectors-v2/connector-file/connector-file-base/pom.xml:
##########
@@ -73,5 +75,12 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.flink</groupId>
Review Comment:
If we use flink hadoop jar, the job will failed in spark. So we should set the `scope` of `hadoop` to `provided`.
--
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
[GitHub] [incubator-seatunnel] EricJoy2048 commented on a diff in pull request #2399: [Feature][Connector-V2] Add base source connector code for connector-file-base
Posted by GitBox <gi...@apache.org>.
EricJoy2048 commented on code in PR #2399:
URL: https://github.com/apache/incubator-seatunnel/pull/2399#discussion_r945155962
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/AbstractReadStrategy.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * 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.connectors.seatunnel.file.source.reader;
+
+import org.apache.seatunnel.connectors.seatunnel.file.config.HadoopConf;
+import org.apache.seatunnel.connectors.seatunnel.file.exception.FilePluginException;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.CommonConfigurationKeys;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+public abstract class AbstractReadStrategy implements ReadStrategy {
+ HadoopConf hadoopConf;
+
+ @Override
+ public void init(HadoopConf conf) {
+ this.hadoopConf = conf;
+ }
+
+ @Override
+ public Configuration getConfiguration(HadoopConf hadoopConf) {
Review Comment:
I guess the `S3 File Source` and `OSS File Source` will extend this class too. Does the `Configuration` can use for read `S3 File` and `OSS File`?
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/BaseFileSourceReader.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * 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.connectors.seatunnel.file.source;
+
+import org.apache.seatunnel.api.source.Collector;
+import org.apache.seatunnel.api.source.SourceReader;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.connectors.seatunnel.file.config.HadoopConf;
+import org.apache.seatunnel.connectors.seatunnel.file.source.reader.ReadStrategy;
+import org.apache.seatunnel.connectors.seatunnel.file.source.split.FileSourceSplit;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class BaseFileSourceReader implements SourceReader<SeaTunnelRow, FileSourceSplit> {
+ private static final long THREAD_WAIT_TIME = 500L;
+ private final ReadStrategy readStrategy;
+ private final HadoopConf hadoopConf;
+ private final SourceReader.Context context;
+ private final Set<FileSourceSplit> sourceSplits;
+
+ public BaseFileSourceReader(ReadStrategy readStrategy, HadoopConf hadoopConf, SourceReader.Context context) {
+ this.readStrategy = readStrategy;
+ this.hadoopConf = hadoopConf;
+ this.context = context;
+ this.sourceSplits = new HashSet<>();
+ }
+
+ @Override
+ public void open() throws Exception {
+ readStrategy.init(hadoopConf);
+ }
+
+ @Override
+ public void close() throws IOException {
+
+ }
+
+ @Override
+ public void pollNext(Collector<SeaTunnelRow> output) throws Exception {
+ if (sourceSplits.isEmpty()) {
+ Thread.sleep(THREAD_WAIT_TIME);
+ return;
+ }
+ sourceSplits.forEach(source -> {
+ try {
+ readStrategy.read(source.splitId(), output);
+ } catch (Exception e) {
+ throw new RuntimeException("File source read error", e);
+ }
+ });
+ context.signalNoMoreElement();
Review Comment:
We should consider that the `File Source Connector` should also support streaming jobs? In the feature, we plan to support read local file in streaming model which is like `Flume`. Of course, you can improve it in the future PR.
--
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
[GitHub] [incubator-seatunnel] TyrantLucifer commented on a diff in pull request #2399: [Feature][Connector-V2] Add base source connector code for connector-file-base
Posted by GitBox <gi...@apache.org>.
TyrantLucifer commented on code in PR #2399:
URL: https://github.com/apache/incubator-seatunnel/pull/2399#discussion_r945257914
##########
seatunnel-connectors-v2/connector-file/connector-file-base/pom.xml:
##########
@@ -73,5 +75,12 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.flink</groupId>
Review Comment:
Yes, you are right, I will change it.
--
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
[GitHub] [incubator-seatunnel] EricJoy2048 commented on pull request #2399: [Feature][Connector-V2] Add base source connector code for connector-file-base
Posted by GitBox <gi...@apache.org>.
EricJoy2048 commented on PR #2399:
URL: https://github.com/apache/incubator-seatunnel/pull/2399#issuecomment-1214583147
+1 LGTM
cc @CalvinKirs
--
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
[GitHub] [incubator-seatunnel] TyrantLucifer commented on a diff in pull request #2399: [Feature][Connector-V2] Add base source connector code for connector-file-base
Posted by GitBox <gi...@apache.org>.
TyrantLucifer commented on code in PR #2399:
URL: https://github.com/apache/incubator-seatunnel/pull/2399#discussion_r945158727
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/BaseFileSourceReader.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * 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.connectors.seatunnel.file.source;
+
+import org.apache.seatunnel.api.source.Collector;
+import org.apache.seatunnel.api.source.SourceReader;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.connectors.seatunnel.file.config.HadoopConf;
+import org.apache.seatunnel.connectors.seatunnel.file.source.reader.ReadStrategy;
+import org.apache.seatunnel.connectors.seatunnel.file.source.split.FileSourceSplit;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class BaseFileSourceReader implements SourceReader<SeaTunnelRow, FileSourceSplit> {
+ private static final long THREAD_WAIT_TIME = 500L;
+ private final ReadStrategy readStrategy;
+ private final HadoopConf hadoopConf;
+ private final SourceReader.Context context;
+ private final Set<FileSourceSplit> sourceSplits;
+
+ public BaseFileSourceReader(ReadStrategy readStrategy, HadoopConf hadoopConf, SourceReader.Context context) {
+ this.readStrategy = readStrategy;
+ this.hadoopConf = hadoopConf;
+ this.context = context;
+ this.sourceSplits = new HashSet<>();
+ }
+
+ @Override
+ public void open() throws Exception {
+ readStrategy.init(hadoopConf);
+ }
+
+ @Override
+ public void close() throws IOException {
+
+ }
+
+ @Override
+ public void pollNext(Collector<SeaTunnelRow> output) throws Exception {
+ if (sourceSplits.isEmpty()) {
+ Thread.sleep(THREAD_WAIT_TIME);
+ return;
+ }
+ sourceSplits.forEach(source -> {
+ try {
+ readStrategy.read(source.splitId(), output);
+ } catch (Exception e) {
+ throw new RuntimeException("File source read error", e);
+ }
+ });
+ context.signalNoMoreElement();
Review Comment:
I think the first version only supports offline first, and then continue to upgrade to support streaming model.
--
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
[GitHub] [incubator-seatunnel] TyrantLucifer commented on a diff in pull request #2399: [Feature][Connector-V2] Add base source connector code for connector-file-base
Posted by GitBox <gi...@apache.org>.
TyrantLucifer commented on code in PR #2399:
URL: https://github.com/apache/incubator-seatunnel/pull/2399#discussion_r945300837
##########
seatunnel-connectors-v2/connector-file/connector-file-base/pom.xml:
##########
@@ -73,5 +75,12 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.flink</groupId>
Review Comment:
Resolved, 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
[GitHub] [incubator-seatunnel] CalvinKirs merged pull request #2399: [Feature][Connector-V2] Add base source connector code for connector-file-base
Posted by GitBox <gi...@apache.org>.
CalvinKirs merged PR #2399:
URL: https://github.com/apache/incubator-seatunnel/pull/2399
--
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