-
Notifications
You must be signed in to change notification settings - Fork 436
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-33525] Move ImpulseSource to new Source API #950
base: main
Are you sure you want to change the base?
[FLINK-33525] Move ImpulseSource to new Source API #950
Conversation
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.
@Poorvankbhatia thanks for the PR. Did you evaluate if this can be achieved based off of the existing DataGeneratorSource
/GeneratorFunction
? Generally, our approach should be to try to capture usage patterns that might also be required for generating synthetic data by Flink users and make them available by providing utilities in the generator
package.
Yes, absolutely! However, using DataGeneratorSource requires adding a dependency on flink-connector-datagen in autoscaling's pom.xml. I wasn't sure if that was acceptable, so I replicated the original source instead. Let me know if i can add that dependency. |
I think it is fine - datagen's only major transitive dependency is on |
Since this is only an example we should focus on simplicity and add the extra dep to use the built in generator functionality. We should not add new dependencies to the autoscaler, only this example module |
Updated the code. Please have a look. Thanks. |
* Flink's DataGeneratorSource with RateLimiterStrategy is used to control the emission rate. | ||
* | ||
* Rate Calculation: | ||
* - samplingIntervalMs / 10 gives maxSleepTimeMs, which represents the interval between emissions. |
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 believe this section needs to be adjusted. Since we do not control the maxSleepTimeMs directly, but it is rather controlled internally by the Guava's token bucket algorithm, it should not be explicitly mentioned here. It is also not strictly guaranteed to be max - at the startup there can be a short burst. The value 10 seems to just be a hardcoded parameter meaning that we want at least 10 impulses per sampling interval. Basically it should rather explain: check how many sampling intervals are there within a second, make sure that 10 impulses are generated for each sampling interval (IMPULSES_PER_SAMPLING_INTERVAL).
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.
Updated the comment. Let me know if this makes sense.
What is the purpose of the change
This pull request migrates the ImpulseSource (used in LoadSimulationPipeline) to use Flink's DataGeneratorSource, replacing the older SourceFunction.
Brief change log
Verifying this change
This change is already covered by existing tests, such as:
Does this pull request potentially affect one of the following parts:
CustomResourceDescriptors
: noDocumentation