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

Fix an issue in configuring idleTimeBetweenReadsInMillis #1230

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

akidambisrinivasan
Copy link
Contributor

Description of changes:

Fix an issue where the idleTimeBetweenReadInMillis configured via MultiLangDaemon was not taking effect because it used the auto-generated setter from Lombok to set the configured value, while there is a custom setter that must be invoked to set the value correctly.

There is also a general confusion between using Lombok's fluent setter vs custom setter in java.

Unifying the approach to use the custom Lombok-fluent-style setter and deprecating the previously added setIdleTimeBetweenReadsInMillis

Correct way to configure idleTimeBetweenReadsInMillis for MultiLang is to add this in the properties file:
idleTimeBetweenReadsInMillis = 10000 # 10 seconds

Correct way to configure for java:
configsBuilder.retrievalConfig().retrievalSpecificConfig(
new PollingConfig(streamName, kinesisClient)
.idleTimeBetweenReadsInMillis(Duration.ofSeconds(10).toMillis())

Issue # #999, #950, #515

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…Daemon

Fix an issue where the idleTimeBetweenReadInMillis configured
via MultiLangDaemon was not taking effect because it used
the auto-generated setter from Lombok to set the configured value,
while there is a custom setter that must be invoked to set the
value correctly.

There is also a general confusion between using Lombok's setter vs
custom setter in java.

Unifying the approach to use the custom Lombok-fluent-style setter
and deprecating the previously added custom setIdleTimeBetweenReadsInMillis

Correct way to configure idleTimeBetweenReadsInMillis for MultiLang is
to add this in the properties file:
idleTimeBetweenReadsInMillis = 10000 # 10 seconds

Correct way to configure for java:
configsBuilder.retrievalConfig().retrievalSpecificConfig(
    new PollingConfig(streamName, kinesisClient)
        .idleTimeBetweenReadsInMillis(Duration.ofSeconds(10).toMillis())

Issues: awslabs#999, awslabs#950, awslabs#515
Copy link
Contributor

@brendan-p-lynch brendan-p-lynch left a comment

Choose a reason for hiding this comment

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

Pending answers to the below questions it is approved

* </p>
*/
private long idleTimeBetweenReadsInMillis = 1000L;
@Setter(AccessLevel.NONE)
private long idleTimeBetweenReadsInMillis = 1500L;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it we are chaniging this default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the current default of 1000L is never used, if it is not explicitly configured it used a default defined in an internal API which is 1500L, so I am keeping them consistent without behavior change.

* @Deprecated Use {@link PollingConfig#idleTimeBetweenReadsInMillis} instead
*/
@Deprecated
public void setIdleTimeBetweenReadsInMillis(long idleTimeBetweenReadsInMillis) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is going to be the cost of deprecating this. I know that we like everything to be backward compadible. Do we know how many people use this. What will happen to peoples code as they update. Will this require a major release?

It looks to me that it will just call the value below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deprecating will print a warning during compilation for customer still using this. The behavior will still be correct because they both do the same thing.

We want to avoid confusion with multiple ways to do the same thing, so this says explicitly that we want to support the lombok-fluent-like API that customers are already used to using over the other setter.

usePollingConfigIdleTimeValue = true;
this.idleTimeBetweenReadsInMillis = idleTimeBetweenReadsInMillis;
return this;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it we are now returning the 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.

This is just the explicit implementation of lombok fluent api implementation. It follows the fluent interface - https://en.wikipedia.org/wiki/Fluent_interface

@akidambisrinivasan akidambisrinivasan merged commit 44837b7 into awslabs:master Nov 23, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants