Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

[BAHIR-274] Add Flink InfluxDBv2.0 Connector #114

Merged
merged 1 commit into from May 25, 2021
Merged

Conversation

1p4pk
Copy link
Contributor

@1p4pk 1p4pk commented Mar 10, 2021

Hi @AHeise,

@Shark, @raminqaf and myself have prepared the first draft.

We have one question that we directly commented in the code.

Best,
Felix, Ramin & Leon

Copy link
Member

@eskabetxe eskabetxe left a comment

Choose a reason for hiding this comment

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

Thanks @AHeise, @Shark and @raminqaf for the contribution :)

I have added a few comments.

flink-connector-influxdb2/pom.xml Outdated Show resolved Hide resolved
flink-connector-influxdb2/pom.xml Outdated Show resolved Hide resolved
flink-connector-influxdb2/pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
@@ -75,6 +75,7 @@
<module>flink-connector-akka</module>
<module>flink-connector-flume</module>
<module>flink-connector-influxdb</module>
<module>flink-connector-influxdb2</module>
Copy link
Member

Choose a reason for hiding this comment

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

why create another module?
the first one could not be updated?

Copy link
Contributor

@raminqaf raminqaf Mar 11, 2021

Choose a reason for hiding this comment

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

Unfortunately not. Since there are breaking changes in InfluxDB 2.x. Even the java client is written from scratch and it's not compatible with version 1.7 anymore. More information here. We created a separate module to avoid a situation where other users still rely on InfluxDB 1.x connectors.

Copy link
Member

Choose a reason for hiding this comment

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

should we maintain the 1.7 version? its 10 versions down from last one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess yes, because we implemented influxDB 2.X which is still quite new. I guess a lot of people still use the old api.

flink-connector-influxdb2/pom.xml Outdated Show resolved Hide resolved
Copy link

@AHeise AHeise left a comment

Choose a reason for hiding this comment

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

Thank you very much for your contributions. The new CDC source should be interesting for many IoT use cases. A couple of bigger issues:

  • Exception handling should be more explicit. In most cases, it should be simply getting rid of SneakyThrows and use IOException in the interfaces.
  • Parsing of lines seem to be suboptimal.
  • Some important javadocs are missing, especially on the user-facing issues.
  • Please also double-check if you could hide some classes by making them package-private. In this way, the user will only see a few Influx classes in their autocompletion. For example, all the split/enumerator serializers should be non-public.
  • Ditch Properties in favor of Configuration unless there is a good reason to use that.

I'm very happy with the test coverage already and I think the tests are well-structured such that adding new tests later should be very easy.

Copy link

@AHeise AHeise left a comment

Choose a reason for hiding this comment

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

Already looking very good. What's left:

  • double-check the time unit of DataPoint.
  • remove spotless from pom
  • remove log4js.properties (leave it in test/)
  • fix test (on Travis)
    Wait for approval/merge by Bahir committer.

@1p4pk
Copy link
Contributor Author

1p4pk commented Mar 18, 2021

Hi @rmetzger,

could you also review this commit?

Thank you.

Best,
Leon

@1p4pk 1p4pk marked this pull request as ready for review March 24, 2021 14:44
@1p4pk 1p4pk requested a review from eskabetxe March 24, 2021 15:11
Copy link
Member

@eskabetxe eskabetxe left a comment

Choose a reason for hiding this comment

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

LGTM, minor changes requested

flink-connector-influxdb2/pom.xml Outdated Show resolved Hide resolved
flink-connector-influxdb2/pom.xml Outdated Show resolved Hide resolved
flink-connector-influxdb2/pom.xml Outdated Show resolved Hide resolved
@@ -75,6 +75,7 @@
<module>flink-connector-akka</module>
<module>flink-connector-flume</module>
<module>flink-connector-influxdb</module>
<module>flink-connector-influxdb2</module>
Copy link
Member

Choose a reason for hiding this comment

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

should we maintain the 1.7 version? its 10 versions down from last one

@rmetzger
Copy link
Contributor

rmetzger commented Apr 7, 2021

I don't think we can add the presentation in flink-connector-influxdb2/media/benchmarks.pdf to bahir.
Effectively, we are releasing the pdf under the ASL 2.0, but I'm pretty sure that the pdf contains pictures which we haven't created outselves.

@rmetzger
Copy link
Contributor

rmetzger commented Apr 7, 2021

Maybe host the PDF somewhere else and link to it?

@bkahloon
Copy link

bkahloon commented Apr 19, 2021

Hi @1p4pk , @Shark, @raminqaf

I was just wondering if the source connector would be usable via the Flink SQL api. If there isn't a direct integration available with this PR, what work do you suspect would be needed.

Thank you for your help.

@1p4pk 1p4pk requested a review from eskabetxe April 20, 2021 06:52
@1p4pk
Copy link
Contributor Author

1p4pk commented Apr 20, 2021

Hi @bkahloon,

my first guess would be no, as this connector implements the DataStream source API. However, based on the documentation, you need to implement the Table API & SQL user-defined source and sink API for that.

@AHeise should know better, correct me if I am mistaken.

Best,
Leon

@1p4pk
Copy link
Contributor Author

1p4pk commented Apr 20, 2021

@AHeise we added the last suggestions, but I could only re-request a review from one person. Can you have a look again?

@lresende lresende requested a review from rmetzger April 24, 2021 07:53
Copy link
Contributor

@rmetzger rmetzger left a comment

Choose a reason for hiding this comment

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

+1 to merge this PR

Thanks a lot for your contribution!

public final class InfluxDBSourceBuilder<OUT> {

private InfluxDBDataPointDeserializer<OUT> deserializationSchema;
// Configurations
Copy link
Contributor

Choose a reason for hiding this comment

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

not: this comment is not really adding value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Delete it before merging?

* 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.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the benefit of this file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can be deleted. Was used for spotless::apply.

@rmetzger
Copy link
Contributor

I'll merge this PR in the next 24 hours (I want to leave some time because I'm not merging things that frequently here in bahir)

@rmetzger
Copy link
Contributor

rmetzger commented May 3, 2021

Thanks for the additional approval @eskabetxe. I'll merge this now!

@rmetzger
Copy link
Contributor

rmetzger commented May 3, 2021

For your next contribution to Bahir, please create a Jira ticket: https://issues.apache.org/jira/browse/BAHIR-274

@rmetzger
Copy link
Contributor

rmetzger commented May 3, 2021

@1p4pk Could you squash all your commits into one, prefixed with "[BAHIR-274] .." ?
I tried squashing your change, but it seems that you've merged stuff from master in the your branch in between your work. I tried rebasing to master, but that caused conflicts, which I don't have time to resolve right now.

Just force push the cleaned up branch here, then I'll merge it.

Sorry for the back and forth.

@1p4pk 1p4pk changed the title InfluxDBv2.0 Connector [BAHIR-274] Add Flink InfluxDBv2.0 Connector May 11, 2021
@1p4pk
Copy link
Contributor Author

1p4pk commented May 11, 2021

@rmetzger squashed.

@rmetzger
Copy link
Contributor

Thanks a lot. It seems that there are a number of conflicts with master. Could you resolve them?

@1p4pk
Copy link
Contributor Author

1p4pk commented May 11, 2021

Yes @raminqaf squashed all commits ever done in this repo. He is trying to fix it...

@AHeise
Copy link

AHeise commented May 11, 2021

Probably easiest to (re)start from the latest unsquashed commit 03219bf55f6de444dff62422f29062b7a9c1451c.

@raminqaf raminqaf force-pushed the dev branch 3 times, most recently from f44ad5e to 9315335 Compare May 11, 2021 13:14
@raminqaf
Copy link
Contributor

raminqaf commented May 11, 2021

@rmetzger Everything should be ready and set for the merge now! 🚀 only one small thing:
I noticed that the Travis CI Pipeline is failing (for both environments, scala 2.11 & 2.12) due to three tests in the flume connector. Here is a screenshot of the Travis logs:
image
I found a quick fix for it: I just updated to the newest version of testcontainers, and it seems that this fixes the problem. I created a PR for this issue. The pipeline passes successfully. I didn't know how to create an issue on Jira but maybe you can help me out on that :) Also, I couldn't add anyone to the reviewers on my PR.

@rmetzger
Copy link
Contributor

Thanks a lot for the hotfix. Could you rebase to the latest master to see if the build now passes?

@raminqaf raminqaf force-pushed the dev branch 2 times, most recently from 1fbe8d6 to 2d4e331 Compare May 21, 2021 08:07
Co-authored-by: Leon Papke <leonpapke@gmx.de>
Co-authored-by: Felix Seidel <felix@seidel.me>
@raminqaf
Copy link
Contributor

@rmetzger sry for all the continuous pushes... there were a bunch of conflicts and branch hell going on.. everything should be in place and correct now!

@rmetzger
Copy link
Contributor

Thanks a lot for adjusting!

Merging PR.

@rmetzger rmetzger merged commit 809a588 into apache:master May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants