Date: Mon, 27 Jul 2020 15:36:30 -0700
Subject: [PATCH 03/13] Unmark metrics classes as preview
---
.../feature-AWSSDKforJavav2-96cbff5.json | 5 +++++
.../metrics/LoggingMetricPublisher.java | 4 ----
.../amazon/awssdk/metrics/MetricCategory.java | 4 ----
.../awssdk/metrics/MetricCollection.java | 4 ----
.../awssdk/metrics/MetricCollector.java | 4 ----
.../amazon/awssdk/metrics/MetricLevel.java | 4 ----
.../awssdk/metrics/MetricPublisher.java | 4 ----
.../amazon/awssdk/metrics/MetricRecord.java | 4 ----
.../awssdk/metrics/NoOpMetricCollector.java | 4 ----
.../amazon/awssdk/metrics/SdkMetric.java | 4 ----
.../amazon/awssdk/metrics/package-info.java | 19 -------------------
.../core/RequestOverrideConfiguration.java | 8 --------
.../config/ClientOverrideConfiguration.java | 9 +--------
.../awssdk/core/metrics/CoreMetric.java | 5 -----
.../amazon/awssdk/http/Http2Metric.java | 4 ----
.../amazon/awssdk/http/HttpMetric.java | 4 ----
.../cloudwatch-metric-publisher/pom.xml | 2 +-
.../cloudwatch/CloudWatchMetricPublisher.java | 4 ----
.../publishers/cloudwatch/package-info.java | 19 -------------------
test/tests-coverage-reporting/pom.xml | 4 ++--
20 files changed, 9 insertions(+), 110 deletions(-)
create mode 100644 .changes/next-release/feature-AWSSDKforJavav2-96cbff5.json
delete mode 100644 core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/package-info.java
delete mode 100644 metric-publishers/cloudwatch-metric-publisher/src/main/java/software/amazon/awssdk/metrics/publishers/cloudwatch/package-info.java
diff --git a/.changes/next-release/feature-AWSSDKforJavav2-96cbff5.json b/.changes/next-release/feature-AWSSDKforJavav2-96cbff5.json
new file mode 100644
index 000000000000..ddfb668241a9
--- /dev/null
+++ b/.changes/next-release/feature-AWSSDKforJavav2-96cbff5.json
@@ -0,0 +1,5 @@
+{
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "description": "The client-side metrics feature is out of developer preview and is now generaly available."
+}
diff --git a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/LoggingMetricPublisher.java b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/LoggingMetricPublisher.java
index f5a6fce87d50..004f41c63e81 100644
--- a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/LoggingMetricPublisher.java
+++ b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/LoggingMetricPublisher.java
@@ -15,17 +15,13 @@
package software.amazon.awssdk.metrics;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.utils.Logger;
/**
* An implementation of {@link MetricPublisher} that writes all published metrics to the logs at the INFO level under the
* {@code software.amazon.awssdk.metrics.LoggingMetricPublisher} namespace.
- *
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
*/
-@SdkPreviewApi
@SdkPublicApi
public final class LoggingMetricPublisher implements MetricPublisher {
private static final Logger LOGGER = Logger.loggerFor(LoggingMetricPublisher.class);
diff --git a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricCategory.java b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricCategory.java
index aaecb83ae724..f034c2184997 100644
--- a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricCategory.java
+++ b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricCategory.java
@@ -15,7 +15,6 @@
package software.amazon.awssdk.metrics;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
/**
@@ -23,10 +22,7 @@
*
* A metric can be tagged with multiple categories. Clients can enable/disable metric collection
* at a {@link MetricCategory} level.
- *
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
*/
-@SdkPreviewApi
@SdkPublicApi
public enum MetricCategory {
/**
diff --git a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricCollection.java b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricCollection.java
index cfd5ba23bf0f..5eb4a031de98 100644
--- a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricCollection.java
+++ b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricCollection.java
@@ -19,15 +19,11 @@
import java.util.List;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
/**
* An immutable collection of metrics.
- *
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
*/
-@SdkPreviewApi
@SdkPublicApi
public interface MetricCollection extends Iterable> {
/**
diff --git a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricCollector.java b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricCollector.java
index e22e17039e4c..c4599ab37411 100644
--- a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricCollector.java
+++ b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricCollector.java
@@ -16,16 +16,12 @@
package software.amazon.awssdk.metrics;
import software.amazon.awssdk.annotations.NotThreadSafe;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.metrics.internal.DefaultMetricCollector;
/**
* Used to collect metrics reported by the SDK.
- *
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
*/
-@SdkPreviewApi
@NotThreadSafe
@SdkPublicApi
public interface MetricCollector {
diff --git a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricLevel.java b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricLevel.java
index 0c5bdfcee6bd..5c87d9805a68 100644
--- a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricLevel.java
+++ b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricLevel.java
@@ -15,17 +15,13 @@
package software.amazon.awssdk.metrics;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
/**
* The {@code MetricLevel} associated with a {@link SdkMetric}, similar to log levels, defines the 'scenario' in which the metric
* is useful. This makes it easy to reduce the cost of metric publishing (e.g. by setting it to {@link #INFO}), and then increase
* it when additional data level is needed for debugging purposes (e.g. by setting it to {@link #TRACE}.
- *
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
*/
-@SdkPreviewApi
@SdkPublicApi
public enum MetricLevel {
/**
diff --git a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricPublisher.java b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricPublisher.java
index 85ce11d19c47..78fd56616928 100644
--- a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricPublisher.java
+++ b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricPublisher.java
@@ -15,7 +15,6 @@
package software.amazon.awssdk.metrics;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.annotations.ThreadSafe;
import software.amazon.awssdk.utils.SdkAutoCloseable;
@@ -35,10 +34,7 @@
*
* The SDK may invoke methods on the interface from multiple threads
* concurrently so implementations must be threadsafe.
- *
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
*/
-@SdkPreviewApi
@ThreadSafe
@SdkPublicApi
public interface MetricPublisher extends SdkAutoCloseable {
diff --git a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricRecord.java b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricRecord.java
index 44ee098da41d..2ec0cbcb5db2 100644
--- a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricRecord.java
+++ b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/MetricRecord.java
@@ -15,15 +15,11 @@
package software.amazon.awssdk.metrics;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
/**
* A container associating a metric and its value.
- *
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
*/
-@SdkPreviewApi
@SdkPublicApi
public interface MetricRecord {
/**
diff --git a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/NoOpMetricCollector.java b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/NoOpMetricCollector.java
index 09c6dcebb99f..8ebd377aa095 100644
--- a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/NoOpMetricCollector.java
+++ b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/NoOpMetricCollector.java
@@ -15,16 +15,12 @@
package software.amazon.awssdk.metrics;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.metrics.internal.EmptyMetricCollection;
/**
* A metric collector that doesn't do anything.
- *
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
*/
-@SdkPreviewApi
@SdkPublicApi
public final class NoOpMetricCollector implements MetricCollector {
private static final NoOpMetricCollector INSTANCE = new NoOpMetricCollector();
diff --git a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/SdkMetric.java b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/SdkMetric.java
index 61a31ee0eaf3..35e6861e4adb 100644
--- a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/SdkMetric.java
+++ b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/SdkMetric.java
@@ -16,7 +16,6 @@
package software.amazon.awssdk.metrics;
import java.util.Set;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.metrics.internal.DefaultSdkMetric;
@@ -24,10 +23,7 @@
* A specific SDK metric.
*
* @param The type for values of this metric.
- *
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
*/
-@SdkPreviewApi
@SdkPublicApi
public interface SdkMetric {
diff --git a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/package-info.java b/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/package-info.java
deleted file mode 100644
index 4b14e8de0aa5..000000000000
--- a/core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-@SdkPreviewApi
-package software.amazon.awssdk.metrics;
-
-import software.amazon.awssdk.annotations.SdkPreviewApi;
\ No newline at end of file
diff --git a/core/sdk-core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfiguration.java b/core/sdk-core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfiguration.java
index dd0e8e0bb8a5..366afe9f30cb 100644
--- a/core/sdk-core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfiguration.java
+++ b/core/sdk-core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfiguration.java
@@ -26,7 +26,6 @@
import java.util.TreeMap;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Immutable;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.core.signer.Signer;
import software.amazon.awssdk.metrics.MetricPublisher;
@@ -357,26 +356,19 @@ default B putRawQueryParameter(String name, String value) {
* Sets the metric publishers for publishing the metrics collected for this request. This list supersedes
* the metric publisher set on the client.
*
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
- *
* @param metricPublisher The list metric publisher for this request.
* @return This object for method chaining.
*/
- @SdkPreviewApi
B metricPublishers(List metricPublisher);
/**
* Add a metric publisher to the existing list of previously set publishers to be used for publishing metrics
* for this request.
*
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
- *
* @param metricPublisher The metric publisher to add.
*/
- @SdkPreviewApi
B addMetricPublisher(MetricPublisher metricPublisher);
- @SdkPreviewApi
List metricPublishers();
/**
diff --git a/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java b/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java
index d3ef55915d95..834e90c10df9 100644
--- a/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java
+++ b/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java
@@ -24,7 +24,6 @@
import java.util.Optional;
import java.util.TreeMap;
import java.util.function.Consumer;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
import software.amazon.awssdk.core.retry.RetryMode;
@@ -426,25 +425,19 @@ default Builder retryPolicy(RetryMode retryMode) {
* Set the Metric publishers to be use to publish metrics for this client. This overwrites the current list of
* metric publishers set on the builder.
*
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
- *
* @param metricPublishers The metric publishers.
*/
- @SdkPreviewApi
Builder metricPublishers(List metricPublishers);
+
/**
* Add a metric publisher to the existing list of previously set publishers to be used for publishing metrics
* for this client.
*
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
- *
* @param metricPublisher The metric publisher to add.
*/
- @SdkPreviewApi
Builder addMetricPublisher(MetricPublisher metricPublisher);
- @SdkPreviewApi
List metricPublishers();
}
diff --git a/core/sdk-core/src/main/java/software/amazon/awssdk/core/metrics/CoreMetric.java b/core/sdk-core/src/main/java/software/amazon/awssdk/core/metrics/CoreMetric.java
index 90b208de9188..8cb3c044d81c 100644
--- a/core/sdk-core/src/main/java/software/amazon/awssdk/core/metrics/CoreMetric.java
+++ b/core/sdk-core/src/main/java/software/amazon/awssdk/core/metrics/CoreMetric.java
@@ -16,17 +16,12 @@
package software.amazon.awssdk.core.metrics;
import java.time.Duration;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.core.retry.RetryPolicy;
import software.amazon.awssdk.metrics.MetricCategory;
import software.amazon.awssdk.metrics.MetricLevel;
import software.amazon.awssdk.metrics.SdkMetric;
-/**
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
- */
-@SdkPreviewApi
@SdkPublicApi
public final class CoreMetric {
/**
diff --git a/http-client-spi/src/main/java/software/amazon/awssdk/http/Http2Metric.java b/http-client-spi/src/main/java/software/amazon/awssdk/http/Http2Metric.java
index 4c8a5eb719fc..659c2db78446 100644
--- a/http-client-spi/src/main/java/software/amazon/awssdk/http/Http2Metric.java
+++ b/http-client-spi/src/main/java/software/amazon/awssdk/http/Http2Metric.java
@@ -15,7 +15,6 @@
package software.amazon.awssdk.http;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.metrics.MetricCategory;
import software.amazon.awssdk.metrics.MetricLevel;
@@ -24,10 +23,7 @@
/**
* Metrics collected by HTTP clients for HTTP/2 operations. See {@link HttpMetric} for metrics that are available on both HTTP/1
* and HTTP/2 operations.
- *
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
*/
-@SdkPreviewApi
@SdkPublicApi
public final class Http2Metric {
/**
diff --git a/http-client-spi/src/main/java/software/amazon/awssdk/http/HttpMetric.java b/http-client-spi/src/main/java/software/amazon/awssdk/http/HttpMetric.java
index 40703b10306b..ede491622824 100644
--- a/http-client-spi/src/main/java/software/amazon/awssdk/http/HttpMetric.java
+++ b/http-client-spi/src/main/java/software/amazon/awssdk/http/HttpMetric.java
@@ -15,7 +15,6 @@
package software.amazon.awssdk.http;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.metrics.MetricCategory;
import software.amazon.awssdk.metrics.MetricLevel;
@@ -24,10 +23,7 @@
/**
* Metrics collected by HTTP clients for HTTP/1 and HTTP/2 operations. See {@link Http2Metric} for metrics that are only available
* on HTTP/2 operations.
- *
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
*/
-@SdkPreviewApi
@SdkPublicApi
public final class HttpMetric {
/**
diff --git a/metric-publishers/cloudwatch-metric-publisher/pom.xml b/metric-publishers/cloudwatch-metric-publisher/pom.xml
index e37899b7f547..58a47e59058d 100644
--- a/metric-publishers/cloudwatch-metric-publisher/pom.xml
+++ b/metric-publishers/cloudwatch-metric-publisher/pom.xml
@@ -23,7 +23,7 @@
cloudwatch-metric-publisher
AWS Java SDK :: Metric Publishers :: CloudWatch
jar
- ${awsjavasdk.version}-PREVIEW
+ ${awsjavasdk.version}
${project.parent.version}
diff --git a/metric-publishers/cloudwatch-metric-publisher/src/main/java/software/amazon/awssdk/metrics/publishers/cloudwatch/CloudWatchMetricPublisher.java b/metric-publishers/cloudwatch-metric-publisher/src/main/java/software/amazon/awssdk/metrics/publishers/cloudwatch/CloudWatchMetricPublisher.java
index 055acc67fbf4..565ac92f55d7 100644
--- a/metric-publishers/cloudwatch-metric-publisher/src/main/java/software/amazon/awssdk/metrics/publishers/cloudwatch/CloudWatchMetricPublisher.java
+++ b/metric-publishers/cloudwatch-metric-publisher/src/main/java/software/amazon/awssdk/metrics/publishers/cloudwatch/CloudWatchMetricPublisher.java
@@ -40,7 +40,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Immutable;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.annotations.ThreadSafe;
import software.amazon.awssdk.core.metrics.CoreMetric;
@@ -156,10 +155,7 @@
*
* Warning: Make sure the {@link #close()} this publisher when it is done being used to release all resources it
* consumes. Failure to do so will result in possible thread or file descriptor leaks.
- *
- * NOTE: This is a Preview API and is subject to change so it should not be used in production.
*/
-@SdkPreviewApi
@ThreadSafe
@Immutable
@SdkPublicApi
diff --git a/metric-publishers/cloudwatch-metric-publisher/src/main/java/software/amazon/awssdk/metrics/publishers/cloudwatch/package-info.java b/metric-publishers/cloudwatch-metric-publisher/src/main/java/software/amazon/awssdk/metrics/publishers/cloudwatch/package-info.java
deleted file mode 100644
index 4c7360a33f87..000000000000
--- a/metric-publishers/cloudwatch-metric-publisher/src/main/java/software/amazon/awssdk/metrics/publishers/cloudwatch/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-@SdkPreviewApi
-package software.amazon.awssdk.metrics.publishers.cloudwatch;
-
-import software.amazon.awssdk.annotations.SdkPreviewApi;
\ No newline at end of file
diff --git a/test/tests-coverage-reporting/pom.xml b/test/tests-coverage-reporting/pom.xml
index d3bc9701bda8..95b483b677b5 100644
--- a/test/tests-coverage-reporting/pom.xml
+++ b/test/tests-coverage-reporting/pom.xml
@@ -155,7 +155,7 @@
cloudwatch-metric-publisher
software.amazon.awssdk
- ${awsjavasdk.version}-PREVIEW
+ ${awsjavasdk.version}