Skip to content

Commit 661dc6e

Browse files
committed
HADOOP-19654. SDK update: ITestAWSStatisticCollection fails against s3 express
Revert test to original assert (no special treatment of s3 express), and log Initiating GET request" for ease of log scanning. Add to the log4.properties file the settings needed to turn on wire logging, commented out by default.
1 parent 3351e41 commit 661dc6e

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/statistics/ITestAWSStatisticCollection.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,27 @@
1919
package org.apache.hadoop.fs.s3a.statistics;
2020

2121
import org.junit.jupiter.api.Test;
22+
import org.slf4j.Logger;
23+
import org.slf4j.LoggerFactory;
2224

2325
import org.apache.hadoop.conf.Configuration;
2426
import org.apache.hadoop.fs.Path;
2527
import org.apache.hadoop.fs.s3a.S3AFileSystem;
2628
import org.apache.hadoop.fs.s3a.S3ATestUtils;
2729
import org.apache.hadoop.fs.s3a.performance.AbstractS3ACostTest;
2830

29-
import static org.apache.hadoop.fs.s3a.Constants.FS_S3A_CREATE_PERFORMANCE;
30-
import static org.apache.hadoop.fs.s3a.Constants.FS_S3A_PERFORMANCE_FLAGS;
3131
import static org.apache.hadoop.fs.s3a.Constants.S3EXPRESS_CREATE_SESSION;
3232
import static org.apache.hadoop.fs.s3a.S3ATestUtils.setPerformanceFlags;
3333
import static org.apache.hadoop.fs.s3a.Statistic.STORE_IO_REQUEST;
34-
import static org.apache.hadoop.fs.s3a.impl.S3ExpressStorage.STORE_CAPABILITY_S3_EXPRESS_STORAGE;
3534

3635
/**
3736
* Verify that AWS SDK statistics are wired up.
3837
*/
3938
public class ITestAWSStatisticCollection extends AbstractS3ACostTest {
4039

40+
private static final Logger LOG =
41+
LoggerFactory.getLogger(ITestAWSStatisticCollection.class);
42+
4143
@Override
4244
public Configuration createConfiguration() {
4345
final Configuration conf = super.createConfiguration();
@@ -50,14 +52,13 @@ public Configuration createConfiguration() {
5052

5153
@Test
5254
public void testSDKMetricsCostOfGetFileStatusOnFile() throws Throwable {
53-
describe("performing getFileStatus on a file");
55+
describe("Performing getFileStatus() on a file");
5456
Path simpleFile = file(methodPath());
5557
// and repeat on the file looking at AWS wired up stats
5658
final S3AFileSystem fs = getFileSystem();
59+
LOG.info("Initiating GET request for {}", simpleFile);
5760
verifyMetrics(() -> fs.getFileStatus(simpleFile),
58-
with(STORE_IO_REQUEST,
59-
fs.hasPathCapability(new Path("/"), STORE_CAPABILITY_S3_EXPRESS_STORAGE)
60-
? 2 : 1));
61+
with(STORE_IO_REQUEST, 1));
6162
}
6263

6364
}

hadoop-tools/hadoop-aws/src/test/resources/log4j.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,13 @@ log4j.logger.org.apache.hadoop.fs.s3a.SDKV2Upgrade=WARN
6868
# include sensitive information such as account IDs in HTTP headers.
6969
# log4j.logger.software.amazon.awssdk.request=DEBUG
7070

71+
# Log TLS info
72+
#log4j.logger.software.amazon.awssdk.thirdparty.org.apache.http.conn.ssl.SSLConnectionSocketFactory=DEBUG
73+
74+
7175
# Turn on low level HTTP protocol debugging
72-
#log4j.logger.org.apache.http.wire=DEBUG
76+
#log4j.logger.software.amazon.awssdk.thirdparty.org.apache.http.wire=DEBUG
77+
#log4j.logger.software.amazon.awssdk.thirdparty.org.apache.http=DEBUG
7378

7479
# async client
7580
#log4j.logger.io.netty.handler.logging=DEBUG

0 commit comments

Comments
 (0)