[FLINK-6573][Connectors/Common ] Flink MongoDB Connector
What is the purpose of the change
Mongodb as a non-relational database leader in the business scenario there is a lot of work being used, flink's connector is very much needed to support Mongodb connections to meet enterprise needs.
DataStream Connectors
| Name | Compatible with Mongodb database version | Source | Sink | Semantics |
|---|---|---|---|---|
| Mongdb | 5.1-2.6 | support bounded Source | support Async Sink | at most once |
Table API Connectors
| Name | Compatible with Mongodb database version | Source | Sink |
|---|---|---|---|
| Mongdb | 5.1-2.6 | Not supported | Batch Sink |
Brief change log
Main changes are: e8d0655Complete support for Sink under StreamAPI Future Planning: Stream's source and Table's Sink are finished but not yet covered by test cases, I will finish them as soon as possible and commit the code
Question: Mongodb tests using Testcontainers :Mongodb image of docker does not start problem (similar code using kafka's Testcontainers , docker is loaded correctly)
Verifying this change
This PR adds a new test MongodbAsyncSinkBuilderTest、MongodbAsyncSinkITCase to cover the issue.
Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / no) yes
- The public API, i.e., is any changed class annotated with
@Public(Evolving): (yes / no) no - The serializers: (yes / no / don't know) don't know
- The runtime per-record code paths (performance sensitive): (yes / no / don't know) don't know
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know) no
- The S3 file system connector: (yes / no / don't know) no
CI report:
- bedab2aa002ed36c6263f553b09bbbf8688b04bc Azure: FAILURE
Bot commands
The @flinkbot bot supports the following commands:@flinkbot run azurere-run the last Azure build
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community to review your pull request. We will use this comment to track the progress of the review.
Automated Checks
Last check on commit e097b7b506b58adeb85d13eb90cfbb9e4eab3550 (Sun Nov 21 13:25:55 UTC 2021)
Warnings:
- 2 pom.xml files were touched: Check for build and licensing issues.
- No documentation files were touched! Remember to keep the Flink docs up to date!
Mention the bot in a comment to re-run the automated checks.
Review Progress
- ❓ 1. The [description] looks good.
- ❓ 2. There is [consensus] that the contribution should go into to Flink.
- ❓ 3. Needs [attention] from.
- ❓ 4. The change fits into the overall [architecture].
- ❓ 5. Overall code [quality] is good.
Please see the Pull Request Review Guide for a full explanation of the review process.Bot commands
The @flinkbot bot supports the following commands:
@flinkbot approve descriptionto approve one or more aspects (aspects:description,consensus,architectureandquality)@flinkbot approve allto approve all aspects@flinkbot approve-until architectureto approve everything untilarchitecture@flinkbot attention @username1 [@username2 ..]to require somebody's attention@flinkbot disapprove architectureto remove an approval you gave earlier
不支持upsert么
@MonsterChenzhuo Can you please also rebase to the current master? We merged the addition of flink-architecture-tests and it'd be good to add this connector to its dependencies so the rules run for this connector as well.
@Airblader What do I need to do? Do I close the current pr and pull the master branch for a new commit? What does flink-architecture-tests do? Can you give me a brief introduction?
@Airblader I looked at the Connector Testing Framwork today and wondered if there was any connection with flink-architecture-tests.
@slinkydeveloper @Airblader Thank you for your guidance, I will revise the content you pointed out in the next few days
What do I need to do? Do I close the current pr and pull the master branch for a new commit?
No need to close the PR, you can just rebase your branch. For example if you have added the upstream Flink git repository as a remote called upstream, you do
git fetch --all
git rebase upstream/master
git push --force-with-lease
What does flink-architecture-tests do?
It contains several static code checks, e.g. making sure API annotations are correct etc. This was just recently merged into the project, you can have a look at flink-architecture-tests/README.md.
@Airblader Do you think I'm doing the right thing with this current git operation?
No, this doesn't look correct. It looks like you either merged or rebased against the wrong branch.
@Airblader Sorry, I'm a newbie, so I took the time to learn a bit about Git today. I think it should now match what you said: add flink-architecture-tests.
@MonsterChenzhuo 请问这个最后有合入吗?什么版本会出呢?