-
Notifications
You must be signed in to change notification settings - Fork 467
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
Allow InitialPositionInStreamExtended to be specified in properties file #804
Conversation
E.g. initialPositionInStreamExtended = 1617305352
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.
Verified that "InitialPositionInStream.AT_TIMESTAMP" is not currently supported in KCL 2.0 multilang. However, this is supported in KCL 1.x. Thanks for your contribution. Left couple of comments in the PR.
...src/test/java/software/amazon/kinesis/multilang/config/KinesisClientLibConfiguratorTest.java
Outdated
Show resolved
Hide resolved
@@ -93,6 +94,16 @@ public void testWithLongVariables() { | |||
assertEquals(config.getShardSyncIntervalMillis(), 500); | |||
} | |||
|
|||
@Test | |||
public void testWithInitialPositionInStreamExtended() { |
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.
Looks like similar tests are in KCL 1.0, but not in 2.0. In addition to this one, can you please add the following test case (testKCLConfigurationWithInvalidInitialPositionInStream) here? You will have to make "config.getInitialPositionInStreamExtended()" public. But that's fine.
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.
Nice find! Definitely good to test the exception cases as well.
I've updated the tests. I tried to copy the essence of the unit tests you mentioned over, but didn't exactly copy everything word for word since the 1.0 tests seem to be testing the KinesisClientLibConfiguration
instead of the MultiLangDaemonConfiguration
.
So to recap, I believe the unit tests in this test file should now cover these scenarios:
- When
InitialPositionInStreamExtended
is configured with a timestamp, it sets the AT_TIMESTAMP as well as time in theconfig.getInitialPositionInStreamExtended()
.config.getInitialPositionInStreamExtended()
seems to already be public or at least package private forMultiLangDaemonConfiguration
. I don't explicitly see the declaration but I'm assuming it's generated via lomboc . - Exceptions should be thrown when InitialPositionInStreamExtended is not a long value
- Exceptions should be thrown when
InitialPositionInStream
is set to AT_TIMESTAMP - TRIM_HORIZON is a valid value for
initialPositionInStream
- LATEST is a valid value for
initialPositionInStream
*Issue #, if available: #803
*Description of changes: This change allows a user of the multilang daemon to specify an initial timestamp in which the daemon will process records. E.g. if a user specifies
initialPositionInStreamExtended = 1617305352
in the properties file AND the stream does not currently have checkpoints present, the stream will start processing atThursday, April 1, 2021 7:29:12 PM GMT
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.