HuangXingBo commented on a change in pull request #15443:
URL: https://github.com/apache/flink/pull/15443#discussion_r604570336
##########
File path: flink-python/pyflink/datastream/tests/test_connectors.py
##########
@@ -189,3 +190,34 @@ def test_stream_file_sink(self):
def tearDown(self) -> None:
self.test_sink.clear()
+
+
+class FlinkFileSourceTest(PyFlinkTestCase):
+
+ def setUp(self):
+ self.env = StreamExecutionEnvironment.get_execution_environment()
+ self._cxt_clz_loader =
get_gateway().jvm.Thread.currentThread().getContextClassLoader()
+
_load_specific_flink_module_jars('/flink-connectors/flink-connector-files')
+
+ def test_file_source(self):
+ stream_format = StreamFormat.text_line_format()
+ paths = ["/tmp/1.txt", "/tmp/2.txt"]
+ file_source_builder =
FileSource.for_record_stream_format(stream_format, *paths)
+ file_source = file_source_builder\
+ .monitor_continuously(Duration.of_days(1)) \
+
.set_file_enumerator(FileEnumeratorProvider.default_splittable_file_enumerator())
\
+
.set_split_assigner(FileSplitAssignerProvider.locality_aware_split_assigner()) \
+ .build()
+
+ continuous_settting =
file_source.get_java_function().getContinuousEnumerationSettings()
Review comment:
```suggestion
continuous_setting =
file_source.get_java_function().getContinuousEnumerationSettings()
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]