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

Everything else #971

Open
wants to merge 3 commits into
base: v1.x
Choose a base branch
from
Open

Everything else #971

wants to merge 3 commits into from

Conversation

nichgu
Copy link

@nichgu nichgu commented Aug 2, 2022

Description of changes: The remaining changes require to allow for re-compatibility with the DynamoDBStreamsKinesisAdapter. The majority of changes consist of creating interfaces for key classes like the ShardConsumer, renaming these preexisting classes to include the Kinesis prefix (ShardConsumer -> KinesisShardConsumer) to distinguish from any classes that will use the new interfaces (i.e. DynamoDBStreamsShardConsumer), and making several utility classes and functions public so they could be accessed by the adapter or interfaces, such as the InitializationTask

Testing: Testing was done with the StreamsKCLAdapterCheck package which contains Kinesis KCL tests. Changes were also verified with the built in unit tests using mvn test.

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

Copy link
Contributor

@shanmsac shanmsac left a comment

Choose a reason for hiding this comment

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

most of the changes are just creating and using interface and updating class. had some minor comments

@@ -64,24 +61,36 @@ class ShardConsumer {
private final long taskBackoffTimeMillis;
private final boolean skipShardSyncAtWorkerInitializationIfLeasesExist;

@Getter
//@Getter
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we commenting it out and adding separate get function? same for below two commented gets

Copy link
Author

Choose a reason for hiding this comment

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

This is a carry over from the brazil testing as the build couldn't find the getter functions. I will verify that maven can properly read the getter, and remove these changes if tests pass.

@@ -373,9 +382,9 @@ public boolean isSkipShardSyncAtWorkerInitializationIfLeasesExist() {
return skipShardSyncAtWorkerInitializationIfLeasesExist;
}

private enum TaskOutcome {
/*public enum TaskOutcome {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you have moved this to IShardConsumer, why not just remove this?

Copy link
Author

@nichgu nichgu Aug 10, 2022

Choose a reason for hiding this comment

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

Just a carry over from testing. I will remove it.

Comment on lines +1141 to +1146
if(shardConsumerFactory == null){

shardConsumerFactory = new KinesisShardConsumerFactory();
}

return shardConsumerFactory.createShardConsumer(shardInfo,
Copy link
Contributor

Choose a reason for hiding this comment

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

Will there be any conflict if only shardConsumerFactory is set to Kinesis variant and all other are of different type?

Copy link
Author

Choose a reason for hiding this comment

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

I am unsure what you mean by this. The chosen ShardConsumerFactory should create all ShardConsumers so they should all be the same type. Do you mean if the ShardConsumerFactory is the KinesisVariant but other classes like the PeriodicShardSyncManager are the DDB Streams Variant?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean if the ShardConsumerFactory is the KinesisVariant but other classes like the PeriodicShardSyncManager are the DDB Streams Variant?

yes, will it cause any issue?

Copy link
Author

Choose a reason for hiding this comment

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

So a normal KCL application shouldn't have access to anything outside of the standard KCL classes so the shardConsumerFactory and all other classes should be the Kinesis variant. Obviously in an adapter application, using the KinesisShardConsumerFactory with the DDB Streams classes will cause issues but standard KCL applications should never face that issue

Copy link
Contributor

@shanmsac shanmsac left a comment

Choose a reason for hiding this comment

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

lgtm, integ tests and application tests good.

@stair-aws stair-aws added the v1.x Issues related to the 1.x version label Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.x Issues related to the 1.x version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants