flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-6573][Connectors/Common ] Flink MongoDB Connector

Open MonsterChenzhuo opened this issue 4 years ago • 12 comments

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

MonsterChenzhuo avatar Nov 21 '21 13:11 MonsterChenzhuo

CI report:

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

flinkbot avatar Nov 21 '21 13:11 flinkbot

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.

The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

flinkbot avatar Nov 21 '21 13:11 flinkbot

不支持upsert么

dailai avatar Nov 22 '21 04:11 dailai

@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 avatar Nov 24 '21 10:11 Airblader

@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?

MonsterChenzhuo avatar Nov 24 '21 13:11 MonsterChenzhuo

@Airblader I looked at the Connector Testing Framwork today and wondered if there was any connection with flink-architecture-tests.

MonsterChenzhuo avatar Nov 24 '21 13:11 MonsterChenzhuo

@slinkydeveloper @Airblader Thank you for your guidance, I will revise the content you pointed out in the next few days

MonsterChenzhuo avatar Nov 24 '21 13:11 MonsterChenzhuo

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 avatar Nov 24 '21 13:11 Airblader

@Airblader Do you think I'm doing the right thing with this current git operation?

MonsterChenzhuo avatar Nov 24 '21 14:11 MonsterChenzhuo

No, this doesn't look correct. It looks like you either merged or rebased against the wrong branch.

Airblader avatar Nov 24 '21 14:11 Airblader

@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 avatar Nov 25 '21 09:11 MonsterChenzhuo

@MonsterChenzhuo 请问这个最后有合入吗?什么版本会出呢?

ShawshankLin avatar Sep 17 '22 06:09 ShawshankLin