-
Notifications
You must be signed in to change notification settings - Fork 427
[BAHIR-274] Add Flink InfluxDBv2.0 Connector #114
Conversation
...ain/java/org/apache/flink/streaming/connectors/influxdb/sink/commiter/InfluxDBCommitter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...luxdb2/src/main/java/org/apache/flink/streaming/connectors/influxdb/common/InfluxParser.java
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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
...c/main/java/org/apache/flink/streaming/connectors/influxdb/source/InfluxDBSourceBuilder.java
Show resolved
Hide resolved
There was a problem hiding this 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.
...2/src/test/java/org/apache/flink/streaming/connectors/InfluxDBSourceIntegrationTestCase.java
Outdated
Show resolved
Hide resolved
...or-influxdb2/src/test/java/org/apache/flink/streaming/connectors/util/InfluxDBContainer.java
Outdated
Show resolved
Hide resolved
...uxdb2/src/test/java/org/apache/flink/streaming/connectors/util/InfluxDBTestDeserializer.java
Outdated
Show resolved
Hide resolved
...nector-influxdb2/src/test/java/org/apache/flink/streaming/connectors/util/RetentionUnit.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
...influxdb2/src/main/java/org/apache/flink/streaming/connectors/influxdb/common/DataPoint.java
Show resolved
Hide resolved
...influxdb2/src/main/java/org/apache/flink/streaming/connectors/influxdb/common/DataPoint.java
Show resolved
Hide resolved
...rc/main/java/org/apache/flink/streaming/connectors/influxdb/source/http/WriteAPIHandler.java
Outdated
Show resolved
Hide resolved
Hi @rmetzger, could you also review this commit? Thank you. Best, |
There was a problem hiding this 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
...influxdb2/src/main/java/org/apache/flink/streaming/connectors/influxdb/common/DataPoint.java
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> |
There was a problem hiding this comment.
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
...java/org/apache/flink/streaming/connectors/influxdb/sink/writer/InfluxDBPointSerializer.java
Outdated
Show resolved
Hide resolved
I don't think we can add the presentation in |
Maybe host the PDF somewhere else and link to it? |
...luxdb2/src/main/java/org/apache/flink/streaming/connectors/influxdb/common/InfluxParser.java
Outdated
Show resolved
Hide resolved
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, |
@AHeise we added the last suggestions, but I could only re-request a review from one person. Can you have a look again? |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. | ||
*/ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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) |
Thanks for the additional approval @eskabetxe. I'll merge this now! |
For your next contribution to Bahir, please create a Jira ticket: https://issues.apache.org/jira/browse/BAHIR-274 |
@1p4pk Could you squash all your commits into one, prefixed with "[BAHIR-274] .." ? Just force push the cleaned up branch here, then I'll merge it. Sorry for the back and forth. |
@rmetzger squashed. |
Thanks a lot. It seems that there are a number of conflicts with |
Yes @raminqaf squashed all commits ever done in this repo. He is trying to fix it... |
Probably easiest to (re)start from the latest unsquashed commit |
f44ad5e
to
9315335
Compare
@rmetzger Everything should be ready and set for the merge now! 🚀 only one small thing: |
Thanks a lot for the hotfix. Could you rebase to the latest master to see if the build now passes? |
1fbe8d6
to
2d4e331
Compare
Co-authored-by: Leon Papke <[email protected]> Co-authored-by: Felix Seidel <[email protected]>
@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! |
Thanks a lot for adjusting! Merging PR. |
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