OK
This commit is contained in:
parent
091634b259
commit
014c86603d
@ -34,6 +34,7 @@ import org.apache.hadoop.yarn.api.records.NodeReport;
|
|||||||
import org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest;
|
import org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest;
|
||||||
import org.apache.hadoop.yarn.client.api.async.NMClientAsync;
|
import org.apache.hadoop.yarn.client.api.async.NMClientAsync;
|
||||||
import org.apache.hadoop.yarn.client.api.async.AMRMClientAsync;
|
import org.apache.hadoop.yarn.client.api.async.AMRMClientAsync;
|
||||||
|
import org.apache.hadoop.security.UserGroupInformation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* application master for allocating resources of rabit client
|
* application master for allocating resources of rabit client
|
||||||
@ -61,6 +62,8 @@ public class ApplicationMaster {
|
|||||||
// command to launch
|
// command to launch
|
||||||
private String command = "";
|
private String command = "";
|
||||||
|
|
||||||
|
// username
|
||||||
|
private String userName = "";
|
||||||
// application tracker hostname
|
// application tracker hostname
|
||||||
private String appHostName = "";
|
private String appHostName = "";
|
||||||
// tracker URL to do
|
// tracker URL to do
|
||||||
@ -128,6 +131,8 @@ public class ApplicationMaster {
|
|||||||
*/
|
*/
|
||||||
private void initArgs(String args[]) throws IOException {
|
private void initArgs(String args[]) throws IOException {
|
||||||
LOG.info("Invoke initArgs");
|
LOG.info("Invoke initArgs");
|
||||||
|
// get user name
|
||||||
|
userName = UserGroupInformation.getCurrentUser().getShortUserName();
|
||||||
// cached maps
|
// cached maps
|
||||||
Map<String, Path> cacheFiles = new java.util.HashMap<String, Path>();
|
Map<String, Path> cacheFiles = new java.util.HashMap<String, Path>();
|
||||||
for (int i = 0; i < args.length; ++i) {
|
for (int i = 0; i < args.length; ++i) {
|
||||||
@ -272,7 +277,6 @@ public class ApplicationMaster {
|
|||||||
+ ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/stdout"
|
+ ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/stdout"
|
||||||
+ " 2>" + ApplicationConstants.LOG_DIR_EXPANSION_VAR
|
+ " 2>" + ApplicationConstants.LOG_DIR_EXPANSION_VAR
|
||||||
+ "/stderr";
|
+ "/stderr";
|
||||||
LOG.info(cmd);
|
|
||||||
ctx.setCommands(Collections.singletonList(cmd));
|
ctx.setCommands(Collections.singletonList(cmd));
|
||||||
LOG.info(workerResources);
|
LOG.info(workerResources);
|
||||||
ctx.setLocalResources(this.workerResources);
|
ctx.setLocalResources(this.workerResources);
|
||||||
@ -376,8 +380,12 @@ public class ApplicationMaster {
|
|||||||
Collection<TaskRecord> tasks = new java.util.LinkedList<TaskRecord>();
|
Collection<TaskRecord> tasks = new java.util.LinkedList<TaskRecord>();
|
||||||
for (ContainerId cid : failed) {
|
for (ContainerId cid : failed) {
|
||||||
TaskRecord r = runningTasks.remove(cid);
|
TaskRecord r = runningTasks.remove(cid);
|
||||||
if (r == null)
|
if (r == null) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
LOG.info("Task " + r.taskId + "failed on " + r.container.getId() + ". See LOG at : " +
|
||||||
|
String.format("http://%s/node/containerlogs/%s/" + userName,
|
||||||
|
r.container.getNodeHttpAddress(), r.container.getId()));
|
||||||
r.attemptCounter += 1;
|
r.attemptCounter += 1;
|
||||||
r.container = null;
|
r.container = null;
|
||||||
tasks.add(r);
|
tasks.add(r);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user