From 3df96afc64919d60675348deb3fb56bb5f0888ce Mon Sep 17 00:00:00 2001 From: Jack McCluskey Date: Thu, 12 May 2022 15:48:45 -0400 Subject: [PATCH 1/5] Reduce S3ClientBuilder logging level to debug to eliminate verbose statements --- .../beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java b/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java index acb04d913c1f..df5a1f07a6ea 100644 --- a/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java +++ b/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java @@ -42,7 +42,7 @@ public S3ClientBuilder createBuilder(S3Options s3Options) { @VisibleForTesting static S3ClientBuilder createBuilder(S3ClientBuilder builder, S3Options s3Options) { if (s3Options.getAwsRegion() == null) { - LOG.info( + LOG.debug( "The AWS S3 Beam extension was included in this build, but the awsRegion flag " + "was not specified. If you don't plan to use S3, then ignore this message."); } From 19ada29638abe299dfa4b381b13a1cbf225a06f3 Mon Sep 17 00:00:00 2001 From: Jack McCluskey Date: Fri, 13 May 2022 11:04:06 -0400 Subject: [PATCH 2/5] Outright remove logging statement --- .../beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java b/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java index df5a1f07a6ea..348a107aada1 100644 --- a/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java +++ b/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java @@ -32,8 +32,6 @@ */ public class DefaultS3ClientBuilderFactory implements S3ClientBuilderFactory { - private static final Logger LOG = LoggerFactory.getLogger(DefaultS3ClientBuilderFactory.class); - @Override public S3ClientBuilder createBuilder(S3Options s3Options) { return createBuilder(S3Client.builder(), s3Options); @@ -41,11 +39,6 @@ public S3ClientBuilder createBuilder(S3Options s3Options) { @VisibleForTesting static S3ClientBuilder createBuilder(S3ClientBuilder builder, S3Options s3Options) { - if (s3Options.getAwsRegion() == null) { - LOG.debug( - "The AWS S3 Beam extension was included in this build, but the awsRegion flag " - + "was not specified. If you don't plan to use S3, then ignore this message."); - } return ClientBuilderFactory.getFactory(s3Options).create(builder, s3Options); } } From 7a67d64a83112b20ae2de5688a26e0ae7501088d Mon Sep 17 00:00:00 2001 From: Jack McCluskey Date: Fri, 13 May 2022 11:18:43 -0400 Subject: [PATCH 3/5] Remove unused imports --- .../beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java b/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java index 348a107aada1..4d4209a22bb3 100644 --- a/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java +++ b/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/DefaultS3ClientBuilderFactory.java @@ -21,8 +21,6 @@ import org.apache.beam.sdk.io.aws2.options.S3ClientBuilderFactory; import org.apache.beam.sdk.io.aws2.options.S3Options; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import software.amazon.awssdk.services.s3.S3Client; import software.amazon.awssdk.services.s3.S3ClientBuilder; From 1f0b3fff646dc25c2cc20f7e77f73b26b915e7b4 Mon Sep 17 00:00:00 2001 From: Jack McCluskey Date: Fri, 13 May 2022 11:41:33 -0400 Subject: [PATCH 4/5] Remove v1 logging statement equivalent --- .../beam/sdk/io/aws/s3/DefaultS3ClientBuilderFactory.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/s3/DefaultS3ClientBuilderFactory.java b/sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/s3/DefaultS3ClientBuilderFactory.java index 7ed6f6b4cf44..4a6da6f4f2c1 100644 --- a/sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/s3/DefaultS3ClientBuilderFactory.java +++ b/sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/s3/DefaultS3ClientBuilderFactory.java @@ -49,10 +49,6 @@ public AmazonS3ClientBuilder createBuilder(S3Options s3Options) { s3Options.getAwsServiceEndpoint(), s3Options.getAwsRegion())); } else if (!Strings.isNullOrEmpty(s3Options.getAwsRegion())) { builder = builder.withRegion(s3Options.getAwsRegion()); - } else { - LOG.info( - "The AWS S3 Beam extension was included in this build, but the awsRegion flag " - + "was not specified. If you don't plan to use S3, then ignore this message."); } return builder; } From 3575e526001d7531827d8b7f637cecadcd34d2be Mon Sep 17 00:00:00 2001 From: Jack McCluskey Date: Fri, 13 May 2022 11:42:20 -0400 Subject: [PATCH 5/5] Remove unused v1 imports and logging var --- .../beam/sdk/io/aws/s3/DefaultS3ClientBuilderFactory.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/s3/DefaultS3ClientBuilderFactory.java b/sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/s3/DefaultS3ClientBuilderFactory.java index 4a6da6f4f2c1..a00cfc5fea01 100644 --- a/sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/s3/DefaultS3ClientBuilderFactory.java +++ b/sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/s3/DefaultS3ClientBuilderFactory.java @@ -22,8 +22,6 @@ import org.apache.beam.sdk.io.aws.options.S3ClientBuilderFactory; import org.apache.beam.sdk.io.aws.options.S3Options; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Strings; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Construct AmazonS3ClientBuilder with default values of S3 client properties like path style @@ -31,8 +29,6 @@ */ public class DefaultS3ClientBuilderFactory implements S3ClientBuilderFactory { - private static final Logger LOG = LoggerFactory.getLogger(DefaultS3ClientBuilderFactory.class); - @Override public AmazonS3ClientBuilder createBuilder(S3Options s3Options) { AmazonS3ClientBuilder builder =