Skip to content

Commit 6ec39d4

Browse files
committed
Revert "HADOOP-18168. . (#4140)"
This reverts commit 6ab7b72.
1 parent 6ab7b72 commit 6ec39d4

File tree

6 files changed

+18
-170
lines changed

6 files changed

+18
-170
lines changed

hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/testing.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -544,18 +544,6 @@ which address issues. In particular, we encourage testing of Hadoop release
544544
candidates, as these third-party endpoints get even less testing than the
545545
S3 endpoint itself.
546546

547-
### Public datasets used in tests
548-
549-
Some tests rely on the presence of existing public datasets available on Amazon S3.
550-
You may find a number of these in `org.apache.hadoop.fs.s3a.test.PublicDatasetTestUtils`.
551-
552-
When testing against an endpoint which is not part of Amazon S3's standard commercial partition
553-
(`aws`) such as third-party implementations or AWS's China regions, you should replace these
554-
configurations with an empty space (` `) to disable the tests or an existing path in your object
555-
store that supports these tests.
556-
557-
An example of this might be the MarkerTools tests which require a bucket with a large number of
558-
objects or the requester pays tests that require requester pays to be enabled for the bucket.
559547

560548
### Disabling the encryption tests
561549

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
import org.apache.hadoop.fs.FSDataInputStream;
2727
import org.apache.hadoop.fs.FileSystem;
2828
import org.apache.hadoop.fs.Path;
29-
import org.apache.hadoop.fs.s3a.test.PublicDatasetTestUtils;
3029
import org.apache.hadoop.fs.statistics.IOStatisticAssertions;
3130
import org.apache.hadoop.fs.statistics.StreamStatisticNames;
3231

3332
import static org.apache.hadoop.fs.s3a.Constants.ALLOW_REQUESTER_PAYS;
33+
import static org.apache.hadoop.fs.s3a.Constants.ENDPOINT;
3434
import static org.apache.hadoop.fs.s3a.Constants.S3A_BUCKET_PROBE;
3535
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
3636

@@ -42,15 +42,10 @@ public class ITestS3ARequesterPays extends AbstractS3ATestBase {
4242
@Override
4343
protected Configuration createConfiguration() {
4444
Configuration conf = super.createConfiguration();
45-
46-
Path requesterPaysPath = getRequesterPaysPath(conf);
47-
String requesterPaysBucketName = requesterPaysPath.toUri().getHost();
48-
S3ATestUtils.removeBaseAndBucketOverrides(
49-
requesterPaysBucketName,
50-
conf,
45+
S3ATestUtils.removeBaseAndBucketOverrides(conf,
5146
ALLOW_REQUESTER_PAYS,
47+
ENDPOINT,
5248
S3A_BUCKET_PROBE);
53-
5449
return conf;
5550
}
5651

@@ -107,8 +102,14 @@ public void testRequesterPaysDisabledFails() throws Throwable {
107102
}
108103
}
109104

110-
private static Path getRequesterPaysPath(Configuration conf) {
111-
return new Path(PublicDatasetTestUtils.getRequesterPaysObject(conf));
105+
private Path getRequesterPaysPath(Configuration conf) {
106+
String requesterPaysFile =
107+
conf.getTrimmed(KEY_REQUESTER_PAYS_FILE, DEFAULT_REQUESTER_PAYS_FILE);
108+
S3ATestUtils.assume(
109+
"Empty test property: " + KEY_REQUESTER_PAYS_FILE,
110+
!requesterPaysFile.isEmpty()
111+
);
112+
return new Path(requesterPaysFile);
112113
}
113114

114115
}

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

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020

2121
import java.time.Duration;
2222

23-
import org.apache.hadoop.conf.Configuration;
24-
import org.apache.hadoop.fs.s3a.test.PublicDatasetTestUtils;
25-
2623
/**
2724
* Constants for S3A Testing.
2825
*/
@@ -102,19 +99,14 @@ public interface S3ATestConstants {
10299

103100
/**
104101
* Configuration key for an existing object in a requester pays bucket: {@value}.
105-
*
106-
* Accessible via
107-
* {@link PublicDatasetTestUtils#getRequesterPaysObject(Configuration)}.
102+
* If not set, defaults to {@value DEFAULT_REQUESTER_PAYS_FILE}.
108103
*/
109104
String KEY_REQUESTER_PAYS_FILE = TEST_FS_S3A + "requester.pays.file";
110105

111106
/**
112-
* Configuration key for an existing bucket with many objects: {@value}.
113-
*
114-
* This is used for tests depending on buckets with a large number of keys.
107+
* Default path for an S3 object inside a requester pays enabled bucket: {@value}.
115108
*/
116-
String KEY_BUCKET_WITH_MANY_OBJECTS
117-
= TEST_FS_S3A + "bucket-with-many-objects";
109+
String DEFAULT_REQUESTER_PAYS_FILE = "s3a://usgs-landsat/collection02/catalog.json";
118110

119111
/**
120112
* Name of the property to define the timeout for scale tests: {@value}.

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

Lines changed: 0 additions & 101 deletions
This file was deleted.

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@
2828
import org.slf4j.Logger;
2929
import org.slf4j.LoggerFactory;
3030

31-
import org.apache.hadoop.conf.Configuration;
3231
import org.apache.hadoop.fs.FileSystem;
3332
import org.apache.hadoop.fs.Path;
3433
import org.apache.hadoop.fs.contract.ContractTestUtils;
35-
import org.apache.hadoop.fs.s3a.test.PublicDatasetTestUtils;
3634
import org.apache.hadoop.fs.s3a.S3AFileSystem;
3735

3836
import static org.apache.hadoop.fs.s3a.Constants.DIRECTORY_MARKER_POLICY_AUTHORITATIVE;
@@ -309,25 +307,22 @@ public void testRunLimitedAudit() throws Throwable {
309307
}
310308

311309
/**
312-
* Run an audit against a bucket with a large number of objects.
310+
* Run an audit against the landsat bucket.
313311
* <p></p>
314312
* This tests paging/scale against a larger bucket without
315313
* worrying about setup costs.
316314
*/
317315
@Test
318-
public void testRunAuditManyObjectsInBucket() throws Throwable {
319-
describe("Audit a few thousand objects");
316+
public void testRunLimitedLandsatAudit() throws Throwable {
317+
describe("Audit a few thousand landsat objects");
320318
final File audit = tempAuditFile();
321319

322-
Configuration conf = super.createConfiguration();
323-
String bucketUri = PublicDatasetTestUtils.getBucketPrefixWithManyObjects(conf);
324-
325320
runToFailure(EXIT_INTERRUPTED,
326321
MARKERS,
327322
AUDIT,
328323
m(OPT_LIMIT), 3000,
329324
m(OPT_OUT), audit,
330-
bucketUri);
325+
LANDSAT_BUCKET);
331326
readOutput(audit);
332327
}
333328

hadoop-tools/hadoop-aws/src/test/resources/core-site.xml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
<final>false</final>
3131
</property>
3232

33-
<!-- Per-bucket configurations: landsat-pds -->
34-
3533
<property>
3634
<name>fs.s3a.bucket.landsat-pds.endpoint</name>
3735
<value>${central.endpoint}</value>
@@ -57,31 +55,6 @@
5755
<description>Do not add the referrer header to landsat operations</description>
5856
</property>
5957

60-
<!-- Per-bucket configurations: usgs-landsat -->
61-
62-
<property>
63-
<name>fs.s3a.bucket.usgs-landsat.endpoint</name>
64-
<value>${central.endpoint}</value>
65-
</property>
66-
67-
<property>
68-
<name>fs.s3a.bucket.usgs-landsat.requester.pays.enabled</name>
69-
<value>true</value>
70-
<description>usgs-landsat requires requester pays enabled</description>
71-
</property>
72-
73-
<property>
74-
<name>fs.s3a.bucket.usgs-landsat.multipart.purge</name>
75-
<value>false</value>
76-
<description>Don't try to purge uploads in the read-only bucket, as
77-
it will only create log noise.</description>
78-
</property>
79-
80-
<property>
81-
<name>fs.s3a.bucket.usgs-landsat.audit.add.referrer.header</name>
82-
<value>false</value>
83-
</property>
84-
8558

8659
<!--
8760
This is the default endpoint, which can be used to interact

0 commit comments

Comments
 (0)