From b108e9e2d814cc009c4b663799e056a65bf24766 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Tue, 21 Nov 2023 14:55:13 +0000 Subject: [PATCH] HADOOP-18969. S3A: AbstractS3ACostTest to clear bucket fs.s3a.create.performance (#6264) Add the option to the removeBaseAndBucketOverrides() list --- .../s3a/performance/AbstractS3ACostTest.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/performance/AbstractS3ACostTest.java b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/performance/AbstractS3ACostTest.java index e37717bfa1e34..0ecbe4d5b8ded 100644 --- a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/performance/AbstractS3ACostTest.java +++ b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/performance/AbstractS3ACostTest.java @@ -107,7 +107,8 @@ public Configuration createConfiguration() { removeBaseAndBucketOverrides(bucketName, conf, DIRECTORY_MARKER_POLICY, - AUTHORITATIVE_PATH); + AUTHORITATIVE_PATH, + FS_S3A_CREATE_PERFORMANCE); // directory marker options conf.set(DIRECTORY_MARKER_POLICY, keepMarkers @@ -235,6 +236,21 @@ protected Path file(Path path, final boolean overwrite) return path; } + /** + * Create a file with a specific body, returning its path. + * @param path path to file. + * @param overwrite overwrite flag + * @param body body of file + * @return path of new file + */ + protected Path file(Path path, final boolean overwrite, byte[] body) + throws IOException { + ContractTestUtils.createFile(getFileSystem(), path, overwrite, body); + return path; + } + + + /** * Touch a file, overwriting. * @param path path