2222import java .io .FileNotFoundException ;
2323import java .io .FileOutputStream ;
2424import java .io .IOException ;
25+ import java .net .URI ;
2526import java .net .URL ;
2627import java .nio .charset .StandardCharsets ;
2728import java .util .ArrayList ;
7475
7576import static org .apache .hadoop .fs .s3a .S3ATestUtils .disableFilesystemCaching ;
7677import static org .apache .hadoop .fs .s3a .S3ATestUtils .lsR ;
78+ import static org .apache .hadoop .fs .s3a .S3ATestUtils .removeBaseAndBucketOverrides ;
7779import static org .apache .hadoop .fs .s3a .S3AUtils .applyLocatedFiles ;
7880import static org .apache .hadoop .fs .s3a .commit .CommitConstants .FS_S3A_COMMITTER_STAGING_TMP_PATH ;
7981import static org .apache .hadoop .fs .s3a .commit .CommitConstants .MAGIC_PATH_PREFIX ;
8284import static org .apache .hadoop .fs .s3a .commit .staging .Paths .getMultipartUploadCommitsDirectory ;
8385import static org .apache .hadoop .fs .s3a .commit .staging .StagingCommitterConstants .STAGING_UPLOADS ;
8486import static org .apache .hadoop .mapred .JobConf .MAPRED_TASK_ENV ;
87+ import static org .apache .hadoop .mapreduce .lib .input .FileInputFormat .LIST_STATUS_NUM_THREADS ;
8588
8689/**
8790 * Test an MR Job with all the different committers.
105108 * <li>
106109 * The test suites are declared to be executed in ascending order, so
107110 * that for a specific binding, the order is
108- * {@link #test_000(CommitterTestBinding )},
109- * {@link #test_100(CommitterTestBinding )}
110- * {@link #test_200_execute(CommitterTestBinding, java.nio.file.Path )} and finally
111- * {@link #test_500(CommitterTestBinding )}.
111+ * {@link #test_000()},
112+ * {@link #test_100()}
113+ * {@link #test_200_execute()} and finally
114+ * {@link #test_500()}.
112115 * </li>
113116 * <li>
114- * {@link #test_000(CommitterTestBinding )} calls
117+ * {@link #test_000()} calls
115118 * {@link CommitterTestBinding#validate()} to
116119 * as to validate the state of the committer. This is primarily to
117120 * verify that the binding setup mechanism is working.
118121 * </li>
119122 * <li>
120- * {@link #test_100(CommitterTestBinding )} is relayed to
123+ * {@link #test_100()} is relayed to
121124 * {@link CommitterTestBinding#test_100()},
122125 * for any preflight tests.
123126 * </li>
124127 * <li>
125- * The {@link #test_200_execute(CommitterTestBinding, java.nio.file.Path )}
128+ * The {@link #test_200_execute()}
126129 * test runs the MR job for that
127130 * particular binding with standard reporting and verification of the
128131 * outcome.
@@ -165,6 +168,9 @@ public static Collection<Object[]> params() {
165168 */
166169 private final CommitterTestBinding committerTestBinding ;
167170
171+ @ TempDir
172+ private java .nio .file .Path localFilesDir ;
173+
168174 /**
169175 * Parameterized constructor.
170176 * @param committerTestBinding binding for the test.
@@ -186,6 +192,9 @@ public void setup() throws Exception {
186192 protected Configuration createConfiguration () {
187193 Configuration conf = super .createConfiguration ();
188194 disableFilesystemCaching (conf );
195+ removeBaseAndBucketOverrides (conf ,
196+ LIST_STATUS_NUM_THREADS );
197+ conf .setInt (LIST_STATUS_NUM_THREADS , 16 );
189198 return conf ;
190199 }
191200
@@ -208,9 +217,9 @@ public void test_100() throws Throwable {
208217 }
209218
210219 @ Test
211- public void test_200_execute (
212- @ TempDir java .nio .file .Path localFilesDir ) throws Exception {
220+ public void test_200_execute () throws Exception {
213221 describe ("Run an MR with committer %s" , committerName ());
222+ LOG .info ("Local Temp directory is {}" , localFilesDir );
214223
215224 S3AFileSystem fs = getFileSystem ();
216225 // final dest is in S3A
@@ -253,8 +262,10 @@ public void test_200_execute(
253262 jobConf .set (FS_S3A_COMMITTER_UUID , commitUUID );
254263
255264 mrJob .setInputFormatClass (TextInputFormat .class );
256- FileInputFormat .addInputPath (mrJob ,
257- new Path (localFilesDir .getRoot ().toUri ()));
265+
266+ final URI inputPath = localFilesDir .toUri ();
267+ LOG .info ("Job input path {}" , inputPath );
268+ FileInputFormat .addInputPath (mrJob , new Path (inputPath ));
258269
259270 mrJob .setMapperClass (MapClass .class );
260271 mrJob .setNumReduceTasks (0 );
0 commit comments