-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-24228][connectors/firehose] - Unified Async Sink for Kinesis Firehose #18314
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 0cb7e0c (Mon Jan 10 11:02:23 UTC 2022) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
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 commandsThe @flinkbot bot supports the following commands:
|
848e61a
to
1bd1a6c
Compare
1bd1a6c
to
f803a8f
Compare
...in/java/org/apache/flink/connector/kinesis/sink/KinesisDataFirehoseSinkElementConverter.java
Outdated
Show resolved
Hide resolved
...se/src/test/java/org/apache/flink/connector/firehose/sink/testutils/LocalstackContainer.java
Outdated
Show resolved
Hide resolved
Documentation for this work: https://issues.apache.org/jira/browse/FLINK-25692 |
4161e82
to
d782d9c
Compare
...base/src/main/java/org/apache/flink/connector/aws/config/AWSUnifiedSinksConfigConstants.java
Outdated
Show resolved
Hide resolved
flink-connectors/flink-connector-aws-kinesis-data-firehose/pom.xml
Outdated
Show resolved
Hide resolved
flink-connectors/flink-connector-aws-kinesis-data-firehose/pom.xml
Outdated
Show resolved
Hide resolved
flink-connectors/flink-connector-aws-kinesis-data-firehose/pom.xml
Outdated
Show resolved
Hide resolved
...se/src/main/java/org/apache/flink/connector/firehose/sink/KinesisDataFirehoseSinkWriter.java
Outdated
Show resolved
Hide resolved
...se/src/test/java/org/apache/flink/connector/firehose/sink/KinesisDataFirehoseSinkITCase.java
Outdated
Show resolved
Hide resolved
...st/java/org/apache/flink/connector/firehose/sink/testutils/KinesisDataFirehoseTestUtils.java
Outdated
Show resolved
Hide resolved
...se/src/test/java/org/apache/flink/connector/firehose/sink/testutils/LocalstackContainer.java
Outdated
Show resolved
Hide resolved
...se/src/test/java/org/apache/flink/connector/firehose/sink/testutils/LocalstackContainer.java
Outdated
Show resolved
Hide resolved
@CrynetLogistics remember to change the default maxInFlightRequests to 50 and maxBufferedRequests to something sensible. |
d782d9c
to
93cc3c5
Compare
...irehose/src/main/java/org/apache/flink/connector/firehose/sink/KinesisFirehoseException.java
Outdated
Show resolved
Hide resolved
env.execute("Integration Test"); | ||
|
||
List<S3Object> objects = listBucketObjects(s3AsyncClient, BUCKET_NAME); | ||
assertEquals(NUMBER_OF_ELEMENTS, objects.size()); |
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.
Please update this assertion to use assertJ
assertEquals( | ||
testString.getBytes(StandardCharsets.US_ASCII).length, | ||
sinkWriter.getSizeInBytes(record)); |
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.
Change to assertJ and other instances
env.fromSequence(1, 10_000_000L) | ||
.map(Object::toString) | ||
.returns(String.class) | ||
.map(data -> mapper.writeValueAsString(ImmutableMap.of("data", data))); |
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.
nit: Why not use a Json serialisation schema instead of map to string?
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.
Sorry, really struggling to get it working... tried casting to RowData
and using a JsonRowDataSerializationSchema
but getting issues. I can implement my own SerializationSchema, but I feel that might distract from the main point... any help would be much appreciated...
Is it that I need to have
env.fromSequence(...).<somehow cast to RowData>;
and then pass in a JsonRowDataSerializationSchema
to the sink?
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.
As discussed, please remove this. We should not be maintaining sample code in the test package of a module. Let's raise a follow up to remove the KDS sample too
...se/src/test/java/org/apache/flink/connector/firehose/sink/testutils/LocalstackContainer.java
Outdated
Show resolved
Hide resolved
...-connector-aws-base/src/main/java/org/apache/flink/connector/aws/util/AWSAsyncSinksUtil.java
Outdated
Show resolved
Hide resolved
1f858a4
to
909ba3b
Compare
...ehose/src/main/java/org/apache/flink/connector/firehose/sink/KinesisFirehoseSinkBuilder.java
Outdated
Show resolved
Hide resolved
...ehose/src/main/java/org/apache/flink/connector/firehose/sink/KinesisFirehoseSinkBuilder.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/flink/connector/firehose/sink/KinesisFirehoseSinkElementConverter.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/flink/connector/firehose/sink/KinesisFirehoseSinkElementConverter.java
Outdated
Show resolved
Hide resolved
...rehose/src/main/java/org/apache/flink/connector/firehose/sink/KinesisFirehoseSinkWriter.java
Show resolved
Hide resolved
...rehose/src/main/java/org/apache/flink/connector/firehose/sink/KinesisFirehoseSinkWriter.java
Show resolved
Hide resolved
private S3AsyncClient s3AsyncClient; | ||
private FirehoseAsyncClient firehoseAsyncClient; | ||
private IamAsyncClient iamAsyncClient; |
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.
Move these below the static
fields
...rehose/src/test/java/org/apache/flink/connector/firehose/sink/KinesisFirehoseSinkITCase.java
Show resolved
Hide resolved
909ba3b
to
162d5e3
Compare
…based on the Async Sink Base implemented: - Refactored AWSUnifiedSinksUtil into a class that caters for Kinesis and Firehose - Extracted commonalities between KDS & KDF sinks into flink-connector-aws-base - Implemented integration test based on Localstack container - Changing host/container ports to be different, changing HTTP1.1 to being the default, localstack issue fixed - Added docs page, changed type in Firehose, turned logging off, removed unused dependencies.
…r the new Firehose sink.
…lization schema rather than an ElementConverter, thereby encapsulating the Firehose `Record` from the user, verifying stream objects in KinesisFirehoseITCase
162d5e3
to
cabbe4d
Compare
Thanks @CrynetLogistics, LGTM, merging |
What is the purpose of the change
Allows users to write to KDF directly through this sink based on the unified sink (FLIP-141).
Brief change log
(for example:)
Verifying this change
Please make sure both new and modified tests in this PR follows the conventions defined in our code quality guide: https://flink.apache.org/contributing/code-style-and-quality-common.html#testing
(Please pick either of the following options)
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)yDocumentation