本文整理匯總了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);
}
示例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.");
}
}
}
示例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);
}
}
示例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.");
}
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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();
}
示例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);
}