當前位置: 首頁>>代碼示例>>Java>>正文


Java JobID.forName方法代碼示例

本文整理匯總了Java中org.apache.hadoop.mapred.JobID.forName方法的典型用法代碼示例。如果您正苦於以下問題:Java JobID.forName方法的具體用法?Java JobID.forName怎麽用?Java JobID.forName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.mapred.JobID的用法示例。


在下文中一共展示了JobID.forName方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: submitJob

import org.apache.hadoop.mapred.JobID; //導入方法依賴的package包/類
@Override
public RunningJob submitJob(final JobConf job) throws IOException
{
    ensureInvocationGridPresent();
    ExecutorService async = Executors.newSingleThreadExecutor();
    final JobID jobID = JobID.forName("job_"+job.getJobName()+"_0");

    Future jobSubmitted = async.submit(new Callable<Object>() {
        @Override
        public Object call() throws Exception {
            try {
                JobScheduler.getInstance().runOldApiJob(job, jobID, sortEnabled, null, grid);
            } finally {
                if (unloadGrid) {
                    grid.unload();
                }
            }
            return null;
        }
    });
    async.shutdown(); //Will shut down after task is done

    return new HServerRunningJob(jobID, jobSubmitted);
}
 
開發者ID:scaleoutsoftware,項目名稱:hServer,代碼行數:25,代碼來源:HServerJobClient.java

示例2: processKill

import org.apache.hadoop.mapred.JobID; //導入方法依賴的package包/類
@Override
protected void processKill(String jobid) throws IOException
{
    if (mJobConf != null) {
        JobClient jc = new JobClient(mJobConf);
        JobID id = JobID.forName(jobid);
        RunningJob job = jc.getJob(id);
        if (job == null)
            System.out.println("Job with id " + jobid + " is not active");
        else
        {
            job.killJob();
            log.info("Kill " + id + " submitted.");
        }
    }
}
 
開發者ID:sigmoidanalytics,項目名稱:spork-streaming,代碼行數:17,代碼來源:GruntParser.java

示例3: killJob

import org.apache.hadoop.mapred.JobID; //導入方法依賴的package包/類
@Override
public void killJob(String jobID, Configuration conf) throws BackendException {
    try {
        if (conf != null) {
            JobConf jobConf = new JobConf(conf);
            JobClient jc = new JobClient(jobConf);
            JobID id = JobID.forName(jobID);
            RunningJob job = jc.getJob(id);
            if (job == null)
                System.out.println("Job with id " + jobID + " is not active");
            else
            {
                job.killJob();
                log.info("Kill " + id + " submitted.");
            }
        }
    } catch (IOException e) {
        throw new BackendException(e);
    }
}
 
開發者ID:sigmoidanalytics,項目名稱:spork,代碼行數:21,代碼來源:MapReduceLauncher.java

示例4: processKill

import org.apache.hadoop.mapred.JobID; //導入方法依賴的package包/類
@Override
protected void processKill(String jobid) throws IOException
{
    if (mJobConf != null) {
        JobClient jc = new JobClient(mJobConf);
        JobID id = JobID.forName(jobid);
        RunningJob job = jc.getJob(id);
        if (job == null)
            System.out.println("Job with id " + jobid + " is not active");
        else
        {    
            job.killJob();
            log.info("Kill " + id + " submitted.");
        }
    }
}
 
開發者ID:PonIC,項目名稱:PonIC,代碼行數:17,代碼來源:GruntParser.java

示例5: failJob

import org.apache.hadoop.mapred.JobID; //導入方法依賴的package包/類
/**
 * When there is no salvaging this job, fail it.
 *
 * @param e Exception to log to observers
 */
private void failJob(Exception e) {
  LOG.fatal("failJob: Killing job " + getJobId());
  LOG.fatal("failJob: exception " + e.toString());
  try {
    if (getConfiguration().isPureYarnJob()) {
      throw new RuntimeException(
        "BspServiceMaster (YARN profile) is " +
        "FAILING this task, throwing exception to end job run.", e);
    } else {
      @SuppressWarnings("deprecation")
      org.apache.hadoop.mapred.JobClient jobClient =
        new org.apache.hadoop.mapred.JobClient(
          (org.apache.hadoop.mapred.JobConf)
          getContext().getConfiguration());
      @SuppressWarnings("deprecation")
      JobID jobId = JobID.forName(getJobId());
      RunningJob job = jobClient.getJob(jobId);
      job.killJob();
    }
  } catch (IOException ioe) {
    throw new RuntimeException(ioe);
  } finally {
    failureCleanup(e);
  }
}
 
開發者ID:renato2099,項目名稱:giraph-gora,代碼行數:31,代碼來源:BspServiceMaster.java

示例6: killJob

import org.apache.hadoop.mapred.JobID; //導入方法依賴的package包/類
private static void killJob(Configuration conf, String jobIdStr, String reason) {
    LOG.info(reason);
    // "Kill job because of master is already finished
    try {
        org.apache.hadoop.mapred.JobClient jobClient = new org.apache.hadoop.mapred.JobClient(
                (org.apache.hadoop.mapred.JobConf) conf);
        JobID jobId = JobID.forName(jobIdStr);
        RunningJob job = jobClient.getJob(jobId);
        job.killJob();
    } catch (IOException ioe) {
        throw new GuaguaRuntimeException(ioe);
    }
}
 
開發者ID:ShifuML,項目名稱:guagua,代碼行數:14,代碼來源:GuaguaMapReduceClient.java

示例7: HServerJobClient

import org.apache.hadoop.mapred.JobID; //導入方法依賴的package包/類
public HServerJobClient(JobConf conf) throws IOException {
    //super(conf);  -- do not attempt to initialize cluster
    jobID = JobID.forName("job_"+conf.getJobName()+"_0");
    jobConf = conf;
}
 
開發者ID:scaleoutsoftware,項目名稱:hServer,代碼行數:6,代碼來源:HServerJobClient.java

示例8: getCounters

import org.apache.hadoop.mapred.JobID; //導入方法依賴的package包/類
public org.apache.hadoop.mapred.Counters getCounters(String jobid) throws IOException
{
    final JobID jobID = JobID.forName(jobid);
    RunningJob runningJob = jobClient.getJob(jobID);
    return runningJob == null ? null : runningJob.getCounters();
}
 
開發者ID:svemuri,項目名稱:CalcEngine,代碼行數:7,代碼來源:ScriptStats.java

示例9: setMapredJobID

import org.apache.hadoop.mapred.JobID; //導入方法依賴的package包/類
/**
 * Set the mapred ID for this job.
 * @param mapredJobID the mapred job ID for this job.
 * @deprecated use {@link #setAssignedJobID(JobID)} instead
 */
@Deprecated
public void setMapredJobID(String mapredJobID) {
  this.mapredJobID = JobID.forName(mapredJobID);
}
 
開發者ID:rhli,項目名稱:hadoop-EAR,代碼行數:10,代碼來源:Job.java


注:本文中的org.apache.hadoop.mapred.JobID.forName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。