Skip to content

Commit

Permalink
Merge pull request #911 from aws/staging/7afc9f58-c2be-49a4-b124-fd91…
Browse files Browse the repository at this point in the history
…ed9b2313

Pull request: release <- staging/7afc9f58-c2be-49a4-b124-fd91ed9b2313
  • Loading branch information
aws-sdk-java-automation authored Jul 28, 2020
2 parents 10697c0 + 4dad10d commit 87e0523
Show file tree
Hide file tree
Showing 298 changed files with 1,406 additions and 985 deletions.
56 changes: 56 additions & 0 deletions .changes/2.13.63.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"version": "2.13.63",
"date": "2020-07-28",
"entries": [
{
"type": "feature",
"category": "AWS SDK for Java v2",
"description": "Slight performance improvement when metrics are disabled."
},
{
"type": "feature",
"category": "Auto Scaling",
"description": "Now you can enable Instance Metadata Service Version 2 (IMDSv2) or disable the instance metadata endpoint with Launch Configurations."
},
{
"type": "feature",
"category": "Amazon Interactive Video Service",
"description": "Added a new error code, PendingVerification, to differentiate between errors caused by insufficient IAM permissions and errors caused by account verification."
},
{
"type": "feature",
"category": "AWS Elemental MediaLive",
"description": "AWS Elemental MediaLive now supports several new features: EBU-TT-D captions in Microsoft Smooth outputs; interlaced video in HEVC outputs; video noise reduction (using temporal filtering) in HEVC outputs."
},
{
"type": "feature",
"category": "AWS SecurityHub",
"description": "Added UpdateSecurityHubConfiguration API. Security Hub now allows customers to choose whether to automatically enable new controls that are added to an existing standard that the customer enabled. For example, if you enabled Foundational Security Best Practices for an account, you can automatically enable new controls as we add them to that standard. By default, new controls are enabled."
},
{
"type": "bugfix",
"category": "AWS SDK for Java v2",
"description": "Fixed an issue where HTTP status code metrics were not always published for async clients."
},
{
"type": "feature",
"category": "EC2 Image Builder",
"description": "This release updates distribution configurations to allow periods in AMI names."
},
{
"type": "feature",
"category": "Amazon Elastic Compute Cloud",
"description": "Introduces support for tag-on-create capability for the following APIs: CreateVpnConnection, CreateVpnGateway, and CreateCustomerGateway. A user can now add tags while creating these resources. For further detail, please see AWS Tagging Strategies."
},
{
"type": "feature",
"category": "AWS SDK for Java v2",
"description": "Updated service endpoint metadata."
},
{
"type": "feature",
"category": "Amazon Relational Database Service",
"description": "Adds reporting of manual cluster snapshot quota to DescribeAccountAttributes API"
}
]
}
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# __2.13.63__ __2020-07-28__
## __AWS Elemental MediaLive__
- ### Features
- AWS Elemental MediaLive now supports several new features: EBU-TT-D captions in Microsoft Smooth outputs; interlaced video in HEVC outputs; video noise reduction (using temporal filtering) in HEVC outputs.

## __AWS SDK for Java v2__
- ### Features
- Slight performance improvement when metrics are disabled.
- Updated service endpoint metadata.

- ### Bugfixes
- Fixed an issue where HTTP status code metrics were not always published for async clients.

## __AWS SecurityHub__
- ### Features
- Added UpdateSecurityHubConfiguration API. Security Hub now allows customers to choose whether to automatically enable new controls that are added to an existing standard that the customer enabled. For example, if you enabled Foundational Security Best Practices for an account, you can automatically enable new controls as we add them to that standard. By default, new controls are enabled.

## __Amazon Elastic Compute Cloud__
- ### Features
- Introduces support for tag-on-create capability for the following APIs: CreateVpnConnection, CreateVpnGateway, and CreateCustomerGateway. A user can now add tags while creating these resources. For further detail, please see AWS Tagging Strategies.

## __Amazon Interactive Video Service__
- ### Features
- Added a new error code, PendingVerification, to differentiate between errors caused by insufficient IAM permissions and errors caused by account verification.

## __Amazon Relational Database Service__
- ### Features
- Adds reporting of manual cluster snapshot quota to DescribeAccountAttributes API

## __Auto Scaling__
- ### Features
- Now you can enable Instance Metadata Service Version 2 (IMDSv2) or disable the instance metadata endpoint with Launch Configurations.

## __EC2 Image Builder__
- ### Features
- This release updates distribution configurations to allow periods in AMI names.

# __2.13.62__ __2020-07-27__
## __AWS DataSync__
- ### Features
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ To automatically manage module versions (currently all modules have the same ver
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.13.62</version>
<version>2.13.63</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -83,12 +83,12 @@ Alternatively you can add dependencies for the specific services you use only:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>ec2</artifactId>
<version>2.13.62</version>
<version>2.13.63</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.13.62</version>
<version>2.13.63</version>
</dependency>
```

Expand All @@ -100,7 +100,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java</artifactId>
<version>2.13.62</version>
<version>2.13.63</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-lambda/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.13.62</version>
<version>2.13.63</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetype-lambda</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.13.62</version>
<version>2.13.63</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetypes</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-sdk-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.13.62</version>
<version>2.13.63</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>aws-sdk-java</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom-internal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.13.62</version>
<version>2.13.63</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.13.62</version>
<version>2.13.63</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>bom</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.13.62</version>
<version>2.13.63</version>
</parent>
<artifactId>bundle</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion codegen-lite-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.13.62</version>
<version>2.13.63</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-lite-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen-lite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.13.62</version>
<version>2.13.63</version>
</parent>
<artifactId>codegen-lite</artifactId>
<name>AWS Java SDK :: Code Generator Lite</name>
Expand Down
2 changes: 1 addition & 1 deletion codegen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.13.62</version>
<version>2.13.63</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.13.62</version>
<version>2.13.63</version>
</parent>
<artifactId>codegen</artifactId>
<name>AWS Java SDK :: Code Generator</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,12 @@
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.utils.CompletableFutureUtils;
import software.amazon.awssdk.utils.FunctionalUtils;

public final class AsyncClientClass extends AsyncClientInterface {
private static final String PUBLISHER_NAME = "metricPublishers";
private static final String METRIC_COLLECTOR_NAME = "apiCallMetricCollector";
private final IntermediateModel model;
private final PoetExtensions poetExtensions;
private final ClassName className;
Expand Down Expand Up @@ -200,14 +199,19 @@ protected MethodSpec.Builder operationBody(MethodSpec.Builder builder, Operation
builder.addModifiers(Modifier.PUBLIC)
.addAnnotation(Override.class);

builder.addStatement("$1T $2N = $1T.create($3S)",
MetricCollector.class, METRIC_COLLECTOR_NAME, "ApiCall");
builder.addStatement("$T<$T> metricPublishers = "
+ "resolveMetricPublishers(clientConfiguration, $N.overrideConfiguration().orElse(null))",
List.class,
MetricPublisher.class,
opModel.getInput().getVariableName())
.addStatement("$1T apiCallMetricCollector = metricPublishers.isEmpty() ? $2T.create() : $1T.create($3S)",
MetricCollector.class, NoOpMetricCollector.class, "ApiCall");
builder.beginControlFlow("try");

builder.addStatement("$N.reportMetric($T.$L, $S)", METRIC_COLLECTOR_NAME, CoreMetric.class, "SERVICE_ID",
model.getMetadata().getServiceId());
builder.addStatement("$N.reportMetric($T.$L, $S)", METRIC_COLLECTOR_NAME, CoreMetric.class, "OPERATION_NAME",
opModel.getOperationName());
builder.addStatement("apiCallMetricCollector.reportMetric($T.$L, $S)",
CoreMetric.class, "SERVICE_ID", model.getMetadata().getServiceId());
builder.addStatement("apiCallMetricCollector.reportMetric($T.$L, $S)",
CoreMetric.class, "OPERATION_NAME", opModel.getOperationName());

builder.addCode(ClientClassUtils.callApplySignerOverrideMethod(opModel))
.addCode(ClientClassUtils.addEndpointTraitCode(opModel))
Expand Down Expand Up @@ -241,12 +245,7 @@ protected MethodSpec.Builder operationBody(MethodSpec.Builder builder, Operation
"() -> $N.exceptionOccurred(t))", paramName);
}

builder.addStatement("$T<$T> $N = resolveMetricPublishers(clientConfiguration, $N.overrideConfiguration().orElse(null))",
List.class,
MetricPublisher.class,
PUBLISHER_NAME,
opModel.getInput().getVariableName())
.addStatement("$N.forEach(p -> p.publish($N.collect()))", PUBLISHER_NAME, "apiCallMetricCollector")
builder.addStatement("metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()))")
.addStatement("return $T.failedFuture(t)", CompletableFutureUtils.class)
.endControlFlow();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;

//TODO Make SyncClientClass extend SyncClientInterface (similar to what we do in AsyncClientClass)
public class SyncClientClass implements ClassSpec {
Expand Down Expand Up @@ -194,27 +195,23 @@ private List<MethodSpec> operationMethodSpecs(OperationModel opModel) {
method.endControlFlow();
}

String metricCollectorName = "apiCallMetricCollector";

method.addStatement("$1T $2N = $1T.create($3S)",
MetricCollector.class, metricCollectorName, "ApiCall");

String publishersName = "metricPublishers";
method.addStatement("$T<$T> metricPublishers = "
+ "resolveMetricPublishers(clientConfiguration, $N.overrideConfiguration().orElse(null))",
List.class,
MetricPublisher.class,
opModel.getInput().getVariableName())
.addStatement("$1T apiCallMetricCollector = metricPublishers.isEmpty() ? $2T.create() : $1T.create($3S)",
MetricCollector.class, NoOpMetricCollector.class, "ApiCall");

method.beginControlFlow("try")
.addStatement("$N.reportMetric($T.$L, $S)", metricCollectorName, CoreMetric.class, "SERVICE_ID",
model.getMetadata().getServiceId())
.addStatement("$N.reportMetric($T.$L, $S)", metricCollectorName, CoreMetric.class, "OPERATION_NAME",
opModel.getOperationName())
.addStatement("apiCallMetricCollector.reportMetric($T.$L, $S)",
CoreMetric.class, "SERVICE_ID", model.getMetadata().getServiceId())
.addStatement("apiCallMetricCollector.reportMetric($T.$L, $S)",
CoreMetric.class, "OPERATION_NAME", opModel.getOperationName())
.addCode(protocolSpec.executionHandler(opModel))
.endControlFlow()
.beginControlFlow("finally")
.addStatement("$T<$T> $N = resolveMetricPublishers(clientConfiguration, $N.overrideConfiguration().orElse(null))",
List.class,
MetricPublisher.class,
publishersName,
opModel.getInput().getVariableName())
.addStatement("$N.forEach(p -> p.publish($N.collect()))", publishersName, metricCollectorName)
.addStatement("metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()))")
.endControlFlow();

methods.add(method.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ default String publishMetricsWhenComplete() {
}

default String publishMetrics() {
return "List<MetricPublisher> metricPublishers = resolveMetricPublishers(clientConfiguration, "
+ "requestOverrideConfig);\n"
+ "metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));";
return "metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));";
}
}
Loading

0 comments on commit 87e0523

Please sign in to comment.