You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by rmetzger <gi...@git.apache.org> on 2016/06/28 11:55:17 UTC

[GitHub] flink pull request #2175: [FLINK-4085][Kinesis] Set Flink-specific user agen...

GitHub user rmetzger opened a pull request:

    https://github.com/apache/flink/pull/2175

    [FLINK-4085][Kinesis] Set Flink-specific user agent

    I was asked by Amazon to set a Flink specific user agent when accessing the AWS APIs.
    I've set an agent for the consumer, for the producer I could not find any setting.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rmetzger/flink flink4085

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/2175.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2175
    
----
commit b65abd448ca087c4b49bb841ff4a95efaeebdb36
Author: Robert Metzger <rm...@apache.org>
Date:   2016-06-28T11:54:12Z

    [FLINK-4085][Kinesis] Set Flink-specific user agent

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2175: [FLINK-4085][Kinesis] Set Flink-specific user agen...

Posted by tzulitai <gi...@git.apache.org>.
Github user tzulitai commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2175#discussion_r68752667
  
    --- Diff: flink-streaming-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/proxy/KinesisProxy.java ---
    @@ -73,7 +76,14 @@ public KinesisProxy(Properties configProps) {
     		this.configProps = checkNotNull(configProps);
     
     		this.regionId = configProps.getProperty(KinesisConfigConstants.CONFIG_AWS_REGION);
    +		ClientConfigurationFactory configurationFactory = new ClientConfigurationFactory();
    +		ClientConfiguration config = configurationFactory.getConfig();
    +		if(config.getUserAgent().equals(ClientConfiguration.DEFAULT_USER_AGENT)) {
    +			// set specific user agent
    +			config.setUserAgent("Apache Flink " + EnvironmentInformation.getVersion() + " (" + EnvironmentInformation.getRevisionInformation().commitId + ") Kinesis Connector");
    +		}
     		AmazonKinesisClient client = new AmazonKinesisClient(AWSUtil.getCredentialsProvider(configProps).getCredentials());
    --- End diff --
    
    The client isn't using the new `ClientConfiguration`.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #2175: [FLINK-4085][Kinesis] Set Flink-specific user agent

Posted by rmetzger <gi...@git.apache.org>.
Github user rmetzger commented on the issue:

    https://github.com/apache/flink/pull/2175
  
    Thank you for the review. It seems that I'm not that focused today ;)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2175: [FLINK-4085][Kinesis] Set Flink-specific user agen...

Posted by rmetzger <gi...@git.apache.org>.
Github user rmetzger commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2175#discussion_r68757009
  
    --- Diff: flink-streaming-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/proxy/KinesisProxy.java ---
    @@ -73,7 +76,14 @@ public KinesisProxy(Properties configProps) {
     		this.configProps = checkNotNull(configProps);
     
     		this.regionId = configProps.getProperty(KinesisConfigConstants.CONFIG_AWS_REGION);
    +		ClientConfigurationFactory configurationFactory = new ClientConfigurationFactory();
    +		ClientConfiguration config = configurationFactory.getConfig();
    +		if(config.getUserAgent().equals(ClientConfiguration.DEFAULT_USER_AGENT)) {
    +			// set specific user agent
    +			config.setUserAgent("Apache Flink " + EnvironmentInformation.getVersion() + " (" + EnvironmentInformation.getRevisionInformation().commitId + ") Kinesis Connector");
    +		}
     		AmazonKinesisClient client = new AmazonKinesisClient(AWSUtil.getCredentialsProvider(configProps).getCredentials());
    --- End diff --
    
    oh, indeed ;)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2175: [FLINK-4085][Kinesis] Set Flink-specific user agen...

Posted by rmetzger <gi...@git.apache.org>.
Github user rmetzger commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2175#discussion_r68757090
  
    --- Diff: flink-streaming-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/proxy/KinesisProxy.java ---
    @@ -73,7 +76,14 @@ public KinesisProxy(Properties configProps) {
     		this.configProps = checkNotNull(configProps);
     
     		this.regionId = configProps.getProperty(KinesisConfigConstants.CONFIG_AWS_REGION);
    +		ClientConfigurationFactory configurationFactory = new ClientConfigurationFactory();
    +		ClientConfiguration config = configurationFactory.getConfig();
    +		if(config.getUserAgent().equals(ClientConfiguration.DEFAULT_USER_AGENT)) {
    --- End diff --
    
    Will undo this as well


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #2175: [FLINK-4085][Kinesis] Set Flink-specific user agent

Posted by tzulitai <gi...@git.apache.org>.
Github user tzulitai commented on the issue:

    https://github.com/apache/flink/pull/2175
  
    LGTM ;)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2175: [FLINK-4085][Kinesis] Set Flink-specific user agen...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/2175


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2175: [FLINK-4085][Kinesis] Set Flink-specific user agen...

Posted by tzulitai <gi...@git.apache.org>.
Github user tzulitai commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2175#discussion_r68752991
  
    --- Diff: flink-streaming-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/proxy/KinesisProxy.java ---
    @@ -73,7 +76,14 @@ public KinesisProxy(Properties configProps) {
     		this.configProps = checkNotNull(configProps);
     
     		this.regionId = configProps.getProperty(KinesisConfigConstants.CONFIG_AWS_REGION);
    +		ClientConfigurationFactory configurationFactory = new ClientConfigurationFactory();
    +		ClientConfiguration config = configurationFactory.getConfig();
    +		if(config.getUserAgent().equals(ClientConfiguration.DEFAULT_USER_AGENT)) {
    --- End diff --
    
    Why do we have to check if it equals the default user agent before setting it to Flink?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---