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

Added IKinesisProxy injector in Worker.Builder #274

Merged
merged 9 commits into from
Jan 15, 2018
Merged

Added IKinesisProxy injector in Worker.Builder #274

merged 9 commits into from
Jan 15, 2018

Conversation

parijatsinha
Copy link
Contributor

Added IKinesisProxy injector in Worker.Builder to allow injecting custom proxy implementations

Copy link
Contributor

@sahilpalvia sahilpalvia left a comment

Choose a reason for hiding this comment

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

Can you add some testing around this, since we are changing the behavior of the builder.

* Set KinesisProxy for the worker.
*
* @param kinesisProxy
* KinesisProxy uses the AmazonKinesis client to get data from Kinesis or DynamoDBStreams
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you fix this comment, it would be confusing for the customers since KCL already has DDB endpoints. Can you remove DynaoDBStreams from the comment.

@@ -1252,18 +1269,20 @@ public Worker build() {
}
}
if (metricsFactory == null) {
metricsFactory = getMetricsFactory(cloudWatchClient, config);
metricsFactory = Worker.getMetricsFactory(cloudWatchClient, config);
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 this being changed? The getMetricsFactory method is a static method which is accessible within the same class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was changed because the Lombok Getter had the same name as the static method.

.config(config);
builder.build();
assertNotNull(builder.getKinesisProxy());
assertTrue(builder.getKinesisProxy() instanceof KinesisProxy);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not the correct way to test the proxy that is set. We need to make sure that the worker is getting the proxy that we expect it to use.

}

// KinesisProxyImplementation to test KinesisProxy injection.
private class DummyKinesisProxy implements IKinesisProxy {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be able to use KinesisLocalFileProxy instead of creating a new one. Let me get back to you on that one.

@@ -1062,6 +1064,7 @@ private static ExecutorService getExecutorService() {
/**
* Builder to construct a Worker instance.
*/
@Getter
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no use for the builder to have a getter, we should be testing what the builder has created, if that has the correct value.

@sahilpalvia sahilpalvia merged commit 222bcda into awslabs:master Jan 15, 2018
@pfifer pfifer added this to the 1.8.10 milestone Jan 29, 2018
pfifer added a commit to pfifer/amazon-kinesis-client that referenced this pull request Jan 29, 2018
* Allow providing a custom IKinesisProxy implementation.
  * PR awslabs#274
* Checkpointing on a different thread should no longer emit a warning about NullMetricsScope.
  * PR awslabs#284
  * Issue awslabs#48
* Upgraded the AWS Java SDK to version 1.11.271
  * PR awslabs#287
pfifer added a commit that referenced this pull request Jan 31, 2018
* Allow providing a custom IKinesisProxy implementation.
  * PR #274
* Checkpointing on a different thread should no longer emit a warning about NullMetricsScope.
  * PR #284
  * Issue #48
* Upgraded the AWS Java SDK to version 1.11.271
  * PR #287
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.

None yet

3 participants