Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-27564][python] Separate different connectors into separate pac…
…kages This closes #19711.
- Loading branch information
Showing
10 changed files
with
1,803 additions
and
1,625 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
################################################################################ | ||
# 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. | ||
################################################################################ | ||
from pyflink.datastream.connectors.base import Sink, Source | ||
from pyflink.datastream.connectors.file_system import (FileEnumeratorProvider, FileSink, FileSource, | ||
BucketAssigner, FileSourceBuilder, | ||
FileSplitAssignerProvider, OutputFileConfig, | ||
RollingPolicy, | ||
StreamFormat, StreamingFileSink) | ||
from pyflink.datastream.connectors.jdbc import JdbcSink, JdbcConnectionOptions, JdbcExecutionOptions | ||
from pyflink.datastream.connectors.kafka import FlinkKafkaConsumer, FlinkKafkaProducer, Semantic | ||
from pyflink.datastream.connectors.number_seq import NumberSequenceSource | ||
from pyflink.datastream.connectors.pulsar import PulsarDeserializationSchema, PulsarSource, \ | ||
PulsarSourceBuilder, SubscriptionType, StartCursor, StopCursor | ||
from pyflink.datastream.connectors.rabbitmq import RMQConnectionConfig, RMQSource, RMQSink | ||
|
||
|
||
__all__ = [ | ||
'Sink', | ||
'Source', | ||
'FileEnumeratorProvider', | ||
'FileSink', | ||
'FileSource', | ||
'BucketAssigner', | ||
'FileSourceBuilder', | ||
'FileSplitAssignerProvider', | ||
'FlinkKafkaConsumer', | ||
'FlinkKafkaProducer', | ||
'Semantic', | ||
'JdbcSink', | ||
'JdbcConnectionOptions', | ||
'JdbcExecutionOptions', | ||
'NumberSequenceSource', | ||
'OutputFileConfig', | ||
'PulsarDeserializationSchema', | ||
'PulsarSource', | ||
'PulsarSourceBuilder', | ||
'SubscriptionType', | ||
'RMQConnectionConfig', | ||
'RMQSource', | ||
'RMQSink', | ||
'RollingPolicy', | ||
'StartCursor', | ||
'StopCursor', | ||
'StreamFormat', | ||
'StreamingFileSink', | ||
'SubscriptionType' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
################################################################################ | ||
# 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. | ||
################################################################################ | ||
from typing import Union | ||
|
||
from py4j.java_gateway import JavaObject | ||
|
||
from pyflink.datastream.functions import JavaFunctionWrapper | ||
|
||
|
||
class Source(JavaFunctionWrapper): | ||
""" | ||
Base class for all unified data source in Flink. | ||
""" | ||
|
||
def __init__(self, source: Union[str, JavaObject]): | ||
""" | ||
Constructor of Source. | ||
:param source: The java Source object. | ||
""" | ||
super(Source, self).__init__(source) | ||
|
||
|
||
class Sink(JavaFunctionWrapper): | ||
""" | ||
Base class for all unified data sink in Flink. | ||
""" | ||
|
||
def __init__(self, sink: Union[str, JavaObject]): | ||
""" | ||
Constructor of Sink. | ||
:param sink: The java Sink object. | ||
""" | ||
super(Sink, self).__init__(sink) |
Oops, something went wrong.