Skip to content

Conversation

@a49a
Copy link
Contributor

@a49a a49a commented Jun 9, 2022

What is the purpose of the change

If all the classes are placed connectors/_init_.py, conflicts may happen that two classes belonging to two different connectors having the same name.

Brief change log

  • Remove all classes from all list of connectors/_init_.py
  • Reimport class from connector specific packages in test case
  • reimport class from connector specific packages in examples

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)

Comment on lines 32 to 38
'FileEnumeratorProvider',
'FileSink',
'FileSource',
'BucketAssigner',
'FileSourceBuilder',
'FileSplitAssignerProvider',
'FlinkKafkaConsumer',
'FlinkKafkaProducer',
'Semantic',
'JdbcSink',
'JdbcConnectionOptions',
'JdbcExecutionOptions',
'NumberSequenceSource',
'OutputFileConfig',
'PulsarDeserializationSchema',
'PulsarSource',
'PulsarSourceBuilder',
'SubscriptionType',
'PulsarSerializationSchema',
'PulsarSink',
'PulsarSinkBuilder',
'MessageDelayer',
'TopicRoutingMode',
'RMQConnectionConfig',
'RMQSource',
'RMQSink',
'RollingPolicy',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dianfu Should we also move the file connector classes? If so, I will also change its corresponding docs.

Copy link
Contributor

@dianfu dianfu Jun 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deadwind4 Yes, of course. BTW, we should also considering the backward compatibility. One way that may work is adding the following code in the connector/init.py:

def _install():
    from pyflink.datastream.connectors import jdbc
    setattr(pyflink.datastream.connectors, 'JdbcSink', jdbc.JdbcSink)
    ...

_install()
del _install

@a49a a49a marked this pull request as draft June 9, 2022 06:35
@flinkbot
Copy link
Collaborator

flinkbot commented Jun 9, 2022

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@a49a a49a marked this pull request as ready for review June 17, 2022 06:03
@a49a a49a marked this pull request as draft June 17, 2022 06:06
@dianfu
Copy link
Contributor

dianfu commented Aug 8, 2022

Closed which has been addressed in 9dd2b19995beb766f0cd0986b079f2d210c1e836

@dianfu dianfu closed this Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants