Skip to content

Commit f4a96b6

Browse files
Merge pull request #896 from aws/staging/5b2086bc-ab52-45d4-bf64-a220fd04e190
Pull request: release <- staging/5b2086bc-ab52-45d4-bf64-a220fd04e190
2 parents 45d0c53 + 82cddd5 commit f4a96b6

File tree

427 files changed

+10786
-905
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

427 files changed

+10786
-905
lines changed

.changes/2.13.52.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"version": "2.13.52",
3+
"date": "2020-07-07",
4+
"entries": [
5+
{
6+
"type": "feature",
7+
"category": "Amazon Elastic Compute Cloud",
8+
"description": "DescribeAvailabilityZones now returns additional data about Availability Zones and Local Zones."
9+
},
10+
{
11+
"type": "feature",
12+
"category": "Amazon Elastic File System",
13+
"description": "This release adds support for automatic backups of Amazon EFS file systems to further simplify backup management."
14+
},
15+
{
16+
"type": "feature",
17+
"category": "AWS SDK for Java v2",
18+
"description": "This release includes the preview release of the client-side metrics for the AWS SDK for Java v2. The SPI can be found in the `metrics-spi` module, and this release also includes a metric publisher for CloudWatch in `cloudwatch-metric-publisher`. See our post over at the [AWS Developer Blog](https://aws.amazon.com/blogs/developer/category/developer-tools/aws-sdk-for-java/) for additional information."
19+
},
20+
{
21+
"type": "feature",
22+
"category": "AWS Storage Gateway",
23+
"description": "Adding support for file-system driven directory refresh, Case Sensitivity toggle for SMB File Shares, and S3 Prefixes and custom File Share names"
24+
},
25+
{
26+
"type": "feature",
27+
"category": "AWS Glue",
28+
"description": "AWS Glue Data Catalog supports cross account sharing of tables through AWS Lake Formation"
29+
},
30+
{
31+
"type": "feature",
32+
"category": "Amazon CloudFront",
33+
"description": "Amazon CloudFront adds support for a new security policy, TLSv1.2_2019."
34+
},
35+
{
36+
"type": "feature",
37+
"category": "AWS SDK for Java v2",
38+
"description": "Updated service endpoint metadata."
39+
},
40+
{
41+
"type": "feature",
42+
"category": "AWS Lake Formation",
43+
"description": "AWS Lake Formation supports sharing tables with other AWS accounts and organizations"
44+
}
45+
]
46+
}

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
# __2.13.52__ __2020-07-07__
2+
## __AWS Glue__
3+
- ### Features
4+
- AWS Glue Data Catalog supports cross account sharing of tables through AWS Lake Formation
5+
6+
## __AWS Lake Formation__
7+
- ### Features
8+
- AWS Lake Formation supports sharing tables with other AWS accounts and organizations
9+
10+
## __AWS SDK for Java v2__
11+
- ### Features
12+
- This release includes the preview release of the client-side metrics for the AWS SDK for Java v2. The SPI can be found in the `metrics-spi` module, and this release also includes a metric publisher for CloudWatch in `cloudwatch-metric-publisher`. See our post over at the [AWS Developer Blog](https://aws.amazon.com/blogs/developer/category/developer-tools/aws-sdk-for-java/) for additional information.
13+
- Updated service endpoint metadata.
14+
15+
## __AWS Storage Gateway__
16+
- ### Features
17+
- Adding support for file-system driven directory refresh, Case Sensitivity toggle for SMB File Shares, and S3 Prefixes and custom File Share names
18+
19+
## __Amazon CloudFront__
20+
- ### Features
21+
- Amazon CloudFront adds support for a new security policy, TLSv1.2_2019.
22+
23+
## __Amazon Elastic Compute Cloud__
24+
- ### Features
25+
- DescribeAvailabilityZones now returns additional data about Availability Zones and Local Zones.
26+
27+
## __Amazon Elastic File System__
28+
- ### Features
29+
- This release adds support for automatic backups of Amazon EFS file systems to further simplify backup management.
30+
131
# __2.13.51__ __2020-07-06__
232
## __AWS IoT SiteWise__
333
- ### Features

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To automatically manage module versions (currently all modules have the same ver
4949
<dependency>
5050
<groupId>software.amazon.awssdk</groupId>
5151
<artifactId>bom</artifactId>
52-
<version>2.13.51</version>
52+
<version>2.13.52</version>
5353
<type>pom</type>
5454
<scope>import</scope>
5555
</dependency>
@@ -83,12 +83,12 @@ Alternatively you can add dependencies for the specific services you use only:
8383
<dependency>
8484
<groupId>software.amazon.awssdk</groupId>
8585
<artifactId>ec2</artifactId>
86-
<version>2.13.51</version>
86+
<version>2.13.52</version>
8787
</dependency>
8888
<dependency>
8989
<groupId>software.amazon.awssdk</groupId>
9090
<artifactId>s3</artifactId>
91-
<version>2.13.51</version>
91+
<version>2.13.52</version>
9292
</dependency>
9393
```
9494

@@ -100,7 +100,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
100100
<dependency>
101101
<groupId>software.amazon.awssdk</groupId>
102102
<artifactId>aws-sdk-java</artifactId>
103-
<version>2.13.51</version>
103+
<version>2.13.52</version>
104104
</dependency>
105105
```
106106

archetypes/archetype-lambda/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>archetypes</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.13.51</version>
23+
<version>2.13.52</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetype-lambda</artifactId>

archetypes/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>aws-sdk-java-pom</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.13.51</version>
23+
<version>2.13.52</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetypes</artifactId>

aws-sdk-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>software.amazon.awssdk</groupId>
1919
<artifactId>aws-sdk-java-pom</artifactId>
20-
<version>2.13.51</version>
20+
<version>2.13.52</version>
2121
<relativePath>../pom.xml</relativePath>
2222
</parent>
2323
<artifactId>aws-sdk-java</artifactId>

bom-internal/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>aws-sdk-java-pom</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.13.51</version>
23+
<version>2.13.52</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

bom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>software.amazon.awssdk</groupId>
1919
<artifactId>aws-sdk-java-pom</artifactId>
20-
<version>2.13.51</version>
20+
<version>2.13.52</version>
2121
<relativePath>../pom.xml</relativePath>
2222
</parent>
2323
<artifactId>bom</artifactId>

bundle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.13.51</version>
24+
<version>2.13.52</version>
2525
</parent>
2626
<artifactId>bundle</artifactId>
2727
<packaging>jar</packaging>

codegen-lite-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>aws-sdk-java-pom</artifactId>
25-
<version>2.13.51</version>
25+
<version>2.13.52</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-lite-maven-plugin</artifactId>

codegen-lite/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.13.51</version>
24+
<version>2.13.52</version>
2525
</parent>
2626
<artifactId>codegen-lite</artifactId>
2727
<name>AWS Java SDK :: Code Generator Lite</name>

codegen-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>aws-sdk-java-pom</artifactId>
25-
<version>2.13.51</version>
25+
<version>2.13.52</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-maven-plugin</artifactId>

codegen/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.13.51</version>
24+
<version>2.13.52</version>
2525
</parent>
2626
<artifactId>codegen</artifactId>
2727
<name>AWS Java SDK :: Code Generator</name>
@@ -57,6 +57,11 @@
5757
<artifactId>http-client-spi</artifactId>
5858
<version>${awsjavasdk.version}</version>
5959
</dependency>
60+
<dependency>
61+
<groupId>software.amazon.awssdk</groupId>
62+
<artifactId>metrics-spi</artifactId>
63+
<version>${awsjavasdk.version}</version>
64+
</dependency>
6065
<dependency>
6166
<groupId>software.amazon.awssdk</groupId>
6267
<artifactId>regions</artifactId>

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/AsyncClientClass.java

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import static com.squareup.javapoet.TypeSpec.Builder;
1919
import static java.util.Collections.singletonList;
2020
import static javax.lang.model.element.Modifier.PRIVATE;
21+
import static javax.lang.model.element.Modifier.STATIC;
2122
import static software.amazon.awssdk.codegen.poet.client.ClientClassUtils.applyPaginatorUserAgentMethod;
2223
import static software.amazon.awssdk.codegen.poet.client.ClientClassUtils.applySignerOverrideMethod;
2324
import static software.amazon.awssdk.codegen.poet.client.SyncClientClass.getProtocolSpecs;
@@ -31,6 +32,7 @@
3132
import com.squareup.javapoet.TypeSpec;
3233
import java.net.URI;
3334
import java.nio.ByteBuffer;
35+
import java.util.Collections;
3436
import java.util.List;
3537
import java.util.concurrent.Executor;
3638
import java.util.stream.Collectors;
@@ -53,18 +55,24 @@
5355
import software.amazon.awssdk.codegen.poet.StaticImport;
5456
import software.amazon.awssdk.codegen.poet.client.specs.ProtocolSpec;
5557
import software.amazon.awssdk.codegen.poet.eventstream.EventStreamUtils;
58+
import software.amazon.awssdk.core.RequestOverrideConfiguration;
5659
import software.amazon.awssdk.core.async.SdkPublisher;
5760
import software.amazon.awssdk.core.client.config.SdkAdvancedAsyncClientOption;
5861
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
5962
import software.amazon.awssdk.core.client.config.SdkClientOption;
6063
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
6164
import software.amazon.awssdk.core.endpointdiscovery.EndpointDiscoveryRefreshCache;
6265
import software.amazon.awssdk.core.endpointdiscovery.EndpointDiscoveryRequest;
66+
import software.amazon.awssdk.core.metrics.CoreMetric;
67+
import software.amazon.awssdk.metrics.MetricCollector;
68+
import software.amazon.awssdk.metrics.MetricPublisher;
6369
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
6470
import software.amazon.awssdk.utils.CompletableFutureUtils;
6571
import software.amazon.awssdk.utils.FunctionalUtils;
6672

6773
public final class AsyncClientClass extends AsyncClientInterface {
74+
private static final String PUBLISHER_NAME = "metricPublishers";
75+
private static final String METRIC_COLLECTOR_NAME = "apiCallMetricCollector";
6876
private final IntermediateModel model;
6977
private final PoetExtensions poetExtensions;
7078
private final ClassName className;
@@ -100,7 +108,8 @@ public TypeSpec poetSpec() {
100108
.addMethods(operations())
101109
.addMethod(closeMethod())
102110
.addMethods(protocolSpec.additionalMethods())
103-
.addMethod(protocolSpec.initProtocolFactory(model));
111+
.addMethod(protocolSpec.initProtocolFactory(model))
112+
.addMethod(resolveMetricPublishersMethod());
104113

105114
// Kinesis doesn't support CBOR for STS yet so need another protocol factory for JSON
106115
if (model.getMetadata().isCborProtocol()) {
@@ -189,9 +198,18 @@ private MethodSpec closeMethod() {
189198
protected MethodSpec.Builder operationBody(MethodSpec.Builder builder, OperationModel opModel) {
190199

191200
builder.addModifiers(Modifier.PUBLIC)
192-
.addAnnotation(Override.class)
193-
.beginControlFlow("try")
194-
.addCode(ClientClassUtils.callApplySignerOverrideMethod(opModel))
201+
.addAnnotation(Override.class);
202+
203+
builder.addStatement("$1T $2N = $1T.create($3S)",
204+
MetricCollector.class, METRIC_COLLECTOR_NAME, "ApiCall");
205+
builder.beginControlFlow("try");
206+
207+
builder.addStatement("$N.reportMetric($T.$L, $S)", METRIC_COLLECTOR_NAME, CoreMetric.class, "SERVICE_ID",
208+
model.getMetadata().getServiceId());
209+
builder.addStatement("$N.reportMetric($T.$L, $S)", METRIC_COLLECTOR_NAME, CoreMetric.class, "OPERATION_NAME",
210+
opModel.getOperationName());
211+
212+
builder.addCode(ClientClassUtils.callApplySignerOverrideMethod(opModel))
195213
.addCode(ClientClassUtils.addEndpointTraitCode(opModel))
196214
.addCode(protocolSpec.responseHandler(model, opModel));
197215
protocolSpec.errorResponseHandler(opModel).ifPresent(builder::addCode);
@@ -223,8 +241,16 @@ protected MethodSpec.Builder operationBody(MethodSpec.Builder builder, Operation
223241
"() -> $N.exceptionOccurred(t))", paramName);
224242
}
225243

226-
return builder.addStatement("return $T.failedFuture(t)", CompletableFutureUtils.class)
227-
.endControlFlow();
244+
builder.addStatement("$T<$T> $N = resolveMetricPublishers(clientConfiguration, $N.overrideConfiguration().orElse(null))",
245+
List.class,
246+
MetricPublisher.class,
247+
PUBLISHER_NAME,
248+
opModel.getInput().getVariableName())
249+
.addStatement("$N.forEach(p -> p.publish($N.collect()))", PUBLISHER_NAME, "apiCallMetricCollector")
250+
.addStatement("return $T.failedFuture(t)", CompletableFutureUtils.class)
251+
.endControlFlow();
252+
253+
return builder;
228254
}
229255

230256
@Override
@@ -300,4 +326,39 @@ private MethodSpec utilitiesMethod() {
300326
String.join(",", config.getCreateMethodParams()))
301327
.build();
302328
}
329+
330+
private MethodSpec resolveMetricPublishersMethod() {
331+
String clientConfigName = "clientConfiguration";
332+
String requestOverrideConfigName = "requestOverrideConfiguration";
333+
334+
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("resolveMetricPublishers")
335+
.addModifiers(PRIVATE, STATIC)
336+
.returns(ParameterizedTypeName.get(List.class, MetricPublisher.class))
337+
.addParameter(SdkClientConfiguration.class, clientConfigName)
338+
.addParameter(RequestOverrideConfiguration.class, requestOverrideConfigName);
339+
340+
String publishersName = "publishers";
341+
342+
methodBuilder.addStatement("$T $N = null", ParameterizedTypeName.get(List.class, MetricPublisher.class), publishersName);
343+
344+
methodBuilder.beginControlFlow("if ($N != null)", requestOverrideConfigName)
345+
.addStatement("$N = $N.metricPublishers()", publishersName, requestOverrideConfigName)
346+
.endControlFlow();
347+
348+
methodBuilder.beginControlFlow("if ($1N == null || $1N.isEmpty())", publishersName)
349+
.addStatement("$N = $N.option($T.$N)",
350+
publishersName,
351+
clientConfigName,
352+
SdkClientOption.class,
353+
"METRIC_PUBLISHERS")
354+
.endControlFlow();
355+
356+
methodBuilder.beginControlFlow("if ($1N == null)", publishersName)
357+
.addStatement("$N = $T.emptyList()", publishersName, Collections.class)
358+
.endControlFlow();
359+
360+
methodBuilder.addStatement("return $N", publishersName);
361+
362+
return methodBuilder.build();
363+
}
303364
}

0 commit comments

Comments
 (0)