20
20
21
21
import java .io .File ;
22
22
import java .io .FileNotFoundException ;
23
+ import java .io .IOException ;
23
24
import java .nio .charset .StandardCharsets ;
24
25
import java .util .Arrays ;
25
26
import java .util .Collection ;
43
44
import org .apache .hadoop .examples .terasort .TeraSortConfigKeys ;
44
45
import org .apache .hadoop .examples .terasort .TeraValidate ;
45
46
import org .apache .hadoop .fs .Path ;
47
+ import org .apache .hadoop .fs .s3a .S3ATestUtils ;
46
48
import org .apache .hadoop .fs .s3a .commit .AbstractYarnClusterITest ;
47
49
import org .apache .hadoop .fs .s3a .commit .CommitConstants ;
48
50
import org .apache .hadoop .fs .s3a .commit .magic .MagicS3GuardCommitter ;
@@ -118,7 +120,7 @@ public class ITestTerasortOnS3A extends AbstractYarnClusterITest {
118
120
*
119
121
* @return the committer binding for this run.
120
122
*/
121
- @ Parameterized .Parameters (name = "{0}" )
123
+ @ Parameterized .Parameters (name = "{0}-memory={1} " )
122
124
public static Collection <Object []> params () {
123
125
return Arrays .asList (new Object [][]{
124
126
{DirectoryStagingCommitter .NAME , false },
@@ -143,6 +145,11 @@ public void setup() throws Exception {
143
145
prepareToTerasort ();
144
146
}
145
147
148
+ @ Override
149
+ protected void deleteTestDirInTeardown () throws IOException {
150
+ /* no-op */
151
+ }
152
+
146
153
/**
147
154
* Set up the job conf with the options for terasort chosen by the scale
148
155
* options.
@@ -180,14 +187,14 @@ protected int getRowCount() {
180
187
* The paths used must be unique across parameterized runs but
181
188
* common across all test cases in a single parameterized run.
182
189
*/
183
- private void prepareToTerasort () {
190
+ private void prepareToTerasort () throws IOException {
184
191
// small sample size for faster runs
185
- terasortPath = new Path ("/terasort-" + committerName + "-" + trackCommitsInMemory )
186
- .makeQualified (getFileSystem ());
192
+ terasortPath = getFileSystem ().qualify (
193
+ new Path (S3ATestUtils .createTestPath (new Path ("terasort-test" )),
194
+ "terasort-" + committerName + "-" + trackCommitsInMemory ));
187
195
sortInput = new Path (terasortPath , "sortin" );
188
196
sortOutput = new Path (terasortPath , "sortout" );
189
197
sortValidate = new Path (terasortPath , "validate" );
190
-
191
198
}
192
199
193
200
/**
@@ -254,7 +261,7 @@ private void executeStage(
254
261
*/
255
262
@ Test
256
263
public void test_100_terasort_setup () throws Throwable {
257
- describe ("Setting up for a terasort" );
264
+ describe ("Setting up for a terasort with path of %s" , terasortPath );
258
265
259
266
getFileSystem ().delete (terasortPath , true );
260
267
completedStages = new HashMap <>();
@@ -339,7 +346,8 @@ public void test_140_teracomplete() throws Throwable {
339
346
stage .accept ("teravalidate" );
340
347
stage .accept ("overall" );
341
348
String text = results .toString ();
342
- File resultsFile = new File (getReportDir (), committerName + ".csv" );
349
+ File resultsFile = new File (getReportDir (),
350
+ String .format ("%s-%s.csv" , committerName , trackCommitsInMemory ));
343
351
FileUtils .write (resultsFile , text , StandardCharsets .UTF_8 );
344
352
LOG .info ("Results are in {}\n {}" , resultsFile , text );
345
353
}
0 commit comments