Skip to content
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-24943][Connectors / Kinesis] Explicitly create KryoSerializer for SequenceNumber class in Kinesis Consumer #20257

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Cyberness
Copy link

What is the purpose of the change

Create KryoSerializer for SequenceNumber class explicitly to allow disabling of Generic Types via disableGenericTypes() call.

Brief change log

  1. Create KinesisStateUtil class with static method createShardsStateSerializer that explicitly assigns KryoSerializer to SequenceNumber class and use this method to initialize state
  2. Create unit test that checks for compatibility of previous TypeInformation based serializer and explicitly created KryoSerializer
  3. Replace Mokito calls with utility MockStreamingRuntimeContext to improve testability and unify initialization method of Streaming Runtime Context

Verifying this change

Added unit test to verify changed initialization of state.

Does this pull request potentially affect one of the following parts:

Dependencies (does it add or upgrade a dependency): no
The public API, i.e., is any changed class annotated with @public(Evolving): no
The serializers: no
The runtime per-record code paths (performance sensitive): no
Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
The S3 file system connector: no

Documentation

Does this pull request introduce a new feature?: no
If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented): no

…eSerializer` that explicitly assigns `KryoSerializer` to `SequenceNumber` class and use this method to initialize state

2. Create unit test that checks for compatibility of previous `TypeInformation` based serializer and explicitly created `KryoSerializer`
3. Replace `Mokito` calls with utility `MockStreamingRuntimeContext` to improve testability and unify initialization method of Streaming Runtime Context
@flinkbot
Copy link
Collaborator

flinkbot commented Jul 12, 2022

CI report:

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

…eSerializer` that explicitly assigns `KryoSerializer` to `SequenceNumber` class and use this method to initialize state

2. Create unit test that checks for compatibility of previous `TypeInformation` based serializer and explicitly created `KryoSerializer`
3. Replace `Mokito` calls with utility `MockStreamingRuntimeContext` to improve testability and unify initialization method of Streaming Runtime Context
@Cyberness Cyberness closed this Aug 4, 2022
@Cyberness Cyberness reopened this Aug 4, 2022
@hlteoh37
Copy link
Contributor

The code changes look good. Recognise that we specify a KryoSerializer instead of making the SequenceNumber a POJO to maintain backwards compatibility. Given that we are changing the state serializer, could we do a sanity test to check the following?

  • we can disableGenericTypes (as reported here)
  • a snapshot created from old consumer is valid for a new consumer

@Cyberness
Copy link
Author

The code changes look good. Recognise that we specify a KryoSerializer instead of making the SequenceNumber a POJO to maintain backwards compatibility. Given that we are changing the state serializer, could we do a sanity test to check the following?

  • we can disableGenericTypes (as reported here)
  • a snapshot created from old consumer is valid for a new consumer

Yes, I can work on it.

@dannycranmer
Copy link
Contributor

dannycranmer commented Oct 14, 2022

@Cyberness please also rebase and squash commits, and update commit message as per the contribution guide

Copy link
Contributor

@vahmed-hamdy vahmed-hamdy left a comment

Choose a reason for hiding this comment

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

Hey, LGTM as well

@Cyberness
Copy link
Author

Does it still make sense to work on merging this change considering FLINK-30557?

@hlteoh37
Copy link
Contributor

hlteoh37 commented Jan 12, 2023

We have now moved the consumer here https://github.com/apache/flink-connector-aws as part of the connector externalisation effort!

Copy link

This PR is being marked as stale since it has not had any activity in the last 180 days.
If you would like to keep this PR alive, please leave a comment asking for a review.
If the PR has merge conflicts, update it with the latest from the base branch.

If you are having difficulty finding a reviewer, please reach out to the [community](https://flink.apache.org/what-is-flink/community/).

If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 90 days, it will be automatically closed.

@github-actions github-actions bot added the stale label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants