Github user tzulitai commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2260#discussion_r71095891
  
    --- Diff: 
flink-streaming-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/util/AWSUtil.java
 ---
    @@ -50,8 +50,14 @@ public static AmazonKinesisClient 
createKinesisClient(Properties configProps) {
                awsClientConfig.setUserAgent("Apache Flink " + 
EnvironmentInformation.getVersion() +
                        " (" + 
EnvironmentInformation.getRevisionInformation().commitId + ") Kinesis 
Connector");
     
    -           AmazonKinesisClient client =
    -                   new 
AmazonKinesisClient(AWSUtil.getCredentialsProvider(configProps).getCredentials(),
 awsClientConfig);
    +           AmazonKinesisClient client;
    +           if (AWSUtil.getCredentialsProvider(configProps) != null) {
    +                   client = new AmazonKinesisClient(
    +                           
AWSUtil.getCredentialsProvider(configProps).getCredentials(), awsClientConfig);
    --- End diff --
    
    Ah, sorry, I made a misjudgement on my last comment here. It'll actually be 
better to have `AWSUtil.getCredentialsProvider(configProps)` declared as a 
variable outside and reuse it in the `if` clause, otherwise we'll be 
calculating the credentials provider twice. Trivial thing, since it's only a 
one-time thing, but it'll be good to revert it back to what you did in the 
beginning :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to