Skip to content

Commit 0c39b59

Browse files
committed
Add method for large test object (landsat) to PublicDatasetTestUtils
1 parent f73cb3f commit 0c39b59

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.hadoop.conf.Configuration;
2424

2525
import static org.apache.hadoop.fs.s3a.S3ATestConstants.KEY_BUCKET_WITH_MANY_OBJECTS;
26+
import static org.apache.hadoop.fs.s3a.S3ATestConstants.KEY_CSVTEST_FILE;
2627
import static org.apache.hadoop.fs.s3a.S3ATestConstants.KEY_REQUESTER_PAYS_FILE;
2728

2829
/**
@@ -56,6 +57,12 @@ public class PublicDatasetTestUtils {
5657
private static final String DEFAULT_BUCKET_WITH_MANY_OBJECTS
5758
= "s3a://usgs-landsat/collection02/level-1/";
5859

60+
/**
61+
* Default path for the multi MB test file: {@value}.
62+
*/
63+
private static final String DEFAULT_MB_OBJECT
64+
= "s3a://landsat-pds/scene_list.gz";
65+
5966
/**
6067
* Provide a URI for a directory containing many objects.
6168
*
@@ -70,6 +77,19 @@ public static String getBucketPrefixWithManyObjects(Configuration conf) {
7077
KEY_BUCKET_WITH_MANY_OBJECTS, DEFAULT_BUCKET_WITH_MANY_OBJECTS);
7178
}
7279

80+
/**
81+
* Provide a URI to a large (multi MB) object.
82+
*
83+
* Unless otherwise configured,
84+
* this will be {@value DEFAULT_MB_OBJECT}.
85+
*
86+
* @param conf Hadoop configuration
87+
* @return S3A FS URI
88+
*/
89+
public static String getLargeTextObject(Configuration conf) {
90+
return fetchFromConfig(conf, KEY_CSVTEST_FILE, DEFAULT_MB_OBJECT);
91+
}
92+
7393
/**
7494
* Provide a URI to an object within a requester pays enabled bucket.
7595
*

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,14 @@ public interface S3ATestConstants {
8989
*/
9090
String KEY_CSVTEST_FILE = S3A_SCALE_TEST + "csvfile";
9191

92-
/**
93-
* The landsat bucket: {@value}.
94-
*/
95-
String LANDSAT_BUCKET = "s3a://landsat-pds/";
96-
9792
/**
9893
* Default path for the multi MB test file: {@value}.
94+
*
95+
* @deprecated Please use or add an appropriate method
96+
* in {@link PublicDatasetTestUtils}.
9997
*/
100-
String DEFAULT_CSVTEST_FILE = LANDSAT_BUCKET + "scene_list.gz";
98+
@Deprecated
99+
String DEFAULT_CSVTEST_FILE = "s3a://landsat-pds/scene_list.gz";
101100

102101
/**
103102
* Configuration key for an existing object in a requester pays bucket: {@value}.

0 commit comments

Comments
 (0)