当前位置: 首页>>代码示例>>Java>>正文


Java Submitter类代码示例

本文整理汇总了Java中org.apache.hadoop.mapred.pipes.Submitter的典型用法代码示例。如果您正苦于以下问题:Java Submitter类的具体用法?Java Submitter怎么用?Java Submitter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Submitter类属于org.apache.hadoop.mapred.pipes包,在下文中一共展示了Submitter类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runDebugScript

import org.apache.hadoop.mapred.pipes.Submitter; //导入依赖的package包/类
/**
 * Run the debug-script now. Because debug-script can be user code, we use
 * {@link TaskController} to execute the debug script.
 * 
 * @throws IOException
 */
private void runDebugScript() throws IOException {
  String taskStdout ="";
  String taskStderr ="";
  String taskSyslog ="";
  String jobConf = task.getJobFile();
  try {
    // get task's stdout file 
    taskStdout = FileUtil
        .makeShellPath(TaskLog.getRealTaskLogFileLocation(task.getTaskID(),
            task.isTaskCleanupTask(), TaskLog.LogName.STDOUT));
    // get task's stderr file
    taskStderr = FileUtil
        .makeShellPath(TaskLog.getRealTaskLogFileLocation(task.getTaskID(),
            task.isTaskCleanupTask(), TaskLog.LogName.STDERR));
    // get task's syslog file
    taskSyslog = FileUtil
        .makeShellPath(TaskLog.getRealTaskLogFileLocation(task.getTaskID(),
            task.isTaskCleanupTask(), TaskLog.LogName.SYSLOG));
  } catch(Exception e){
    LOG.warn("Exception finding task's stdout/err/syslog files", e);
  }
  File workDir = new File(lDirAlloc.getLocalPathToRead(
      TaskTracker.getLocalTaskDir(task.getUser(), task.getJobID()
          .toString(), task.getTaskID().toString(), task
          .isTaskCleanupTask())
          + Path.SEPARATOR + MRConstants.WORKDIR, localJobConf).toString());
  // Build the command  
  File stdout = TaskLog.getTaskLogFile(task.getTaskID(), task
      .isTaskCleanupTask(), TaskLog.LogName.DEBUGOUT);
  // add pipes program as argument if it exists.
  String program ="";
  String executable = Submitter.getExecutable(localJobConf);
  if ( executable != null) {
    try {
      program = new URI(executable).getFragment();
    } catch (URISyntaxException ur) {
      LOG.warn("Problem in the URI fragment for pipes executable");
    }     
  }
  String [] debug = debugCommand.split(" ");
  List<String> vargs = new ArrayList<String>();
  for (String component : debug) {
    vargs.add(component);
  }
  vargs.add(taskStdout);
  vargs.add(taskStderr);
  vargs.add(taskSyslog);
  vargs.add(jobConf);
  vargs.add(program);
  DebugScriptContext context = 
    new TaskController.DebugScriptContext();
  context.args = vargs;
  context.stdout = stdout;
  context.workDir = workDir;
  context.task = task;
  getTaskController().runDebugScript(context);
  // add the lines of debug out to diagnostics
  int num = localJobConf.getInt(MRJobConfig.TASK_DEBUGOUT_LINES, -1);
  addDiagnostics(FileUtil.makeShellPath(stdout), num, "DEBUG OUT");
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:67,代码来源:TaskTracker.java


注:本文中的org.apache.hadoop.mapred.pipes.Submitter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。