Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
cdbb84c
Update ITestMarkerTool to take many-object bucket from config
dannycjones Apr 5, 2022
0a06a92
Replace default test many-object bucket with 'commoncrawl'
dannycjones Apr 5, 2022
8152d19
Rename testRunLimitedLandsatAudit test
dannycjones Apr 5, 2022
83d62c1
Introduce PublicDatasetTestUtils for bucket with many objects
dannycjones Apr 26, 2022
f058fe4
Migrate ITestS3ARequesterPays to PublicDatasetTestUtils
dannycjones Apr 26, 2022
f73cb3f
Replace common-crawl usage with requester pays bucket usgs-landsat
dannycjones Apr 26, 2022
0c39b59
Add method for large test object (landsat) to PublicDatasetTestUtils
dannycjones Apr 26, 2022
a8e56f3
Revert "Add method for large test object (landsat) to PublicDatasetTe…
dannycjones Apr 27, 2022
8fd79b5
Add private constructor for PublicDatasetTestUtils
dannycjones Apr 27, 2022
11b9541
Fix bucket override configurations for ITestS3ARequesterPays
dannycjones Apr 27, 2022
e734caa
Merge branch 'trunk' into HADOOP-18168
dannycjones Apr 27, 2022
79710a1
Allow endpoint to be configured using bucket overrides
dannycjones Apr 27, 2022
1692c71
Mark PublicDatasetTestUtils class as final
dannycjones Apr 27, 2022
364ce9e
Fix ITestS3ARequesterPays#updateConf JavaDoc
dannycjones Apr 28, 2022
73eeb50
Revert moving super.createConfiguration() logic into helper method
dannycjones Apr 28, 2022
7bbc2b2
Fix S3ATestConstants import
dannycjones Apr 29, 2022
cb19dff
Move PublicDatasetTestUtils to o.a.h.fs.s3a.test
dannycjones Apr 29, 2022
a736bb5
Add note on PublicDatasetTestUtils to testing.md
dannycjones Apr 29, 2022
6302c5b
Fix note 'standard commercial partition'
dannycjones Apr 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,21 @@ public interface S3ATestConstants {
*/
String DEFAULT_REQUESTER_PAYS_FILE = "s3a://usgs-landsat/collection02/catalog.json";

/**
* Configuration key for an existing bucket with many objects: {@value}.
*
* This is used for tests depending on buckets with a large number of keys.
*/
String KEY_BUCKET_WITH_MANY_OBJECTS
= TEST_FS_S3A + "bucket-with-many-objects";

/**
* Default bucket for when {@value KEY_BUCKET_WITH_MANY_OBJECTS} is not set:
* {@value}.
*/
String DEFAULT_BUCKET_MANY_OBJECTS
= "s3a://commoncrawl/";

/**
* Name of the property to define the timeout for scale tests: {@value}.
* Measured in seconds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.contract.ContractTestUtils;
import org.apache.hadoop.fs.s3a.S3AFileSystem;
import org.apache.hadoop.fs.s3a.S3ATestUtils;

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

/**
* Run an audit against the landsat bucket.
* Run an audit against a bucket with a large number of objects.
* <p></p>
* This tests paging/scale against a larger bucket without
* worrying about setup costs.
*/
@Test
public void testRunLimitedLandsatAudit() throws Throwable {
describe("Audit a few thousand landsat objects");
public void testRunAuditManyObjectsInBucket() throws Throwable {
describe("Audit a few thousand objects");
final File audit = tempAuditFile();

Configuration conf = super.createConfiguration();
String bucketUri = getBucketUriWithLargeNumberOfObjects(conf);

runToFailure(EXIT_INTERRUPTED,
MARKERS,
AUDIT,
m(OPT_LIMIT), 3000,
m(OPT_OUT), audit,
LANDSAT_BUCKET);
bucketUri);
readOutput(audit);
}

Expand Down Expand Up @@ -546,4 +551,21 @@ void verifyRenamed(final Path dest,
}
}

/**
* Get s3a URI of a bucket/prefix with a large number of objects from config.
* @param conf Apache Hadoop configuration
* @return s3a URI with large number of objects
*/
private String getBucketUriWithLargeNumberOfObjects(Configuration conf) {
String bucket = conf
.getTrimmed(KEY_BUCKET_WITH_MANY_OBJECTS, DEFAULT_BUCKET_MANY_OBJECTS);

S3ATestUtils.assume(
"Empty test property: " + KEY_BUCKET_WITH_MANY_OBJECTS,
!bucket.isEmpty()
);

return bucket;
}

}