|
@@ -19,6 +19,7 @@
|
|
package org.apache.hadoop.tools.contract;
|
|
package org.apache.hadoop.tools.contract;
|
|
|
|
|
|
import static org.apache.hadoop.fs.contract.ContractTestUtils.*;
|
|
import static org.apache.hadoop.fs.contract.ContractTestUtils.*;
|
|
|
|
+import static org.apache.hadoop.tools.DistCpConstants.CONF_LABEL_DISTCP_JOB_ID;
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
@@ -42,6 +43,7 @@ import org.apache.hadoop.tools.DistCp;
|
|
import org.apache.hadoop.tools.DistCpConstants;
|
|
import org.apache.hadoop.tools.DistCpConstants;
|
|
import org.apache.hadoop.tools.DistCpOptions;
|
|
import org.apache.hadoop.tools.DistCpOptions;
|
|
import org.apache.hadoop.tools.mapred.CopyMapper;
|
|
import org.apache.hadoop.tools.mapred.CopyMapper;
|
|
|
|
+import org.apache.hadoop.tools.util.DistCpTestUtils;
|
|
|
|
|
|
import org.junit.Before;
|
|
import org.junit.Before;
|
|
import org.junit.Rule;
|
|
import org.junit.Rule;
|
|
@@ -464,6 +466,17 @@ public abstract class AbstractContractDistCpTest
|
|
largeFiles(remoteFS, remoteDir, localFS, localDir);
|
|
largeFiles(remoteFS, remoteDir, localFS, localDir);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
+ public void testSetJobId() throws Exception {
|
|
|
|
+ describe("check jobId is set in the conf");
|
|
|
|
+ remoteFS.create(new Path(remoteDir, "file1")).close();
|
|
|
|
+ DistCpTestUtils
|
|
|
|
+ .assertRunDistCp(DistCpConstants.SUCCESS, remoteDir.toString(),
|
|
|
|
+ localDir.toString(), null, conf);
|
|
|
|
+ assertNotNull("DistCp job id isn't set",
|
|
|
|
+ conf.get(CONF_LABEL_DISTCP_JOB_ID));
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Executes a DistCp using a file system sub-tree with multiple nesting
|
|
* Executes a DistCp using a file system sub-tree with multiple nesting
|
|
* levels.
|
|
* levels.
|