-
Notifications
You must be signed in to change notification settings - Fork 63
[FLINK-36975][Connectors/AWS] Fix the AWS Config Option AWS_ROLE_CREDENTIALS_PROVIDER_OPTION to pick the right key #196
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
base: main
Are you sure you want to change the base?
Conversation
…ENTIALS_PROVIDER_OPTION to pick the right key
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.
Thank you for the PR!
… for AWS Kinesis Stream sink
* mock clients. | ||
*/ | ||
@Internal | ||
interface KinesisClientProvider { |
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.
Can this also extend SdkAutoCloseable
so it's inline with the other resource impls?
if (kinesisClientProvider != null) { | ||
// Use the provided client for testing | ||
this.httpClient = null; | ||
this.kinesisClient = kinesisClientProvider.get(); | ||
} else { | ||
// Create a new client as before | ||
this.httpClient = AWSGeneralUtil.createAsyncHttpClient(kinesisClientProperties); | ||
this.kinesisClient = buildClient(kinesisClientProperties, this.httpClient); | ||
} |
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.
Nit: These can be pushed to their own constructors so you don't have to pass in null
or do a null
check.
if (kinesisClientProvider != null) { | ||
kinesisClientProvider.close(); | ||
} else { | ||
AWSGeneralUtil.closeResources(httpClient, kinesisClient); |
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.
IIUC, by having the provider extend SdkAutoCloseable
, you can pass it as the last parameter to the util for resource cleanup.
Purpose of the change
[FLINK-36975][Connectors/AWS] Fix the AWS Config Option AWS_ROLE_CREDENTIALS_PROVIDER_OPTION to pick the right key
https://issues.apache.org/jira/browse/FLINK-36975
Verifying this change
This change added tests and can be verified as follows:
Significant changes
(Please check any boxes [x] if the answer is "yes". You can first publish the PR and check them afterwards, for convenience.)
@Public(Evolving)
)