Example usage for org.apache.hadoop.mapreduce JobID getId

List of usage examples for org.apache.hadoop.mapreduce JobID getId

Introduction

In this page you can find the example usage for org.apache.hadoop.mapreduce JobID getId.

Prototype

public int getId() 

Source Link

Document

returns the int which represents the identifier

Usage

From source file:org.apache.ignite.internal.processors.hadoop.impl.proto.HadoopClientProtocol.java

License:Apache License

/** {@inheritDoc} */
@Override//w w  w  .j  a  va  2s . c  om
public Counters getJobCounters(JobID jobId) throws IOException, InterruptedException {
    try {
        final HadoopCounters counters = execute(HadoopProtocolJobCountersTask.class, jobId.getJtIdentifier(),
                jobId.getId());

        if (counters == null)
            throw new IOException("Job tracker doesn't have any information about the job: " + jobId);

        return new HadoopMapReduceCounters(counters);
    } catch (GridClientException e) {
        throw new IOException("Failed to get job counters: " + jobId, e);
    }
}

From source file:org.apache.ignite.internal.processors.hadoop.proto.HadoopClientProtocol.java

License:Apache License

/** {@inheritDoc} */
@Override/* w  w w  . j a v  a 2s. c  o  m*/
public JobStatus submitJob(JobID jobId, String jobSubmitDir, Credentials ts)
        throws IOException, InterruptedException {
    try {
        conf.setLong(JOB_SUBMISSION_START_TS_PROPERTY, U.currentTimeMillis());

        HadoopJobStatus status = cli.compute().execute(HadoopProtocolSubmitJobTask.class.getName(),
                new HadoopProtocolTaskArguments(jobId.getJtIdentifier(), jobId.getId(), createJobInfo(conf)));

        if (status == null)
            throw new IOException("Failed to submit job (null status obtained): " + jobId);

        return processStatus(status);
    } catch (GridClientException | IgniteCheckedException e) {
        throw new IOException("Failed to submit job.", e);
    }
}

From source file:org.apache.ignite.internal.processors.hadoop.proto.HadoopClientProtocol.java

License:Apache License

/** {@inheritDoc} */
@Override//from   w w w  . ja  v a 2  s  .com
public void killJob(JobID jobId) throws IOException, InterruptedException {
    try {
        cli.compute().execute(HadoopProtocolKillJobTask.class.getName(),
                new HadoopProtocolTaskArguments(jobId.getJtIdentifier(), jobId.getId()));
    } catch (GridClientException e) {
        throw new IOException("Failed to kill job: " + jobId, e);
    }
}

From source file:org.apache.ignite.internal.processors.hadoop.proto.HadoopClientProtocol.java

License:Apache License

/** {@inheritDoc} */
@Override/*from   w w  w.j a  v  a 2 s .c om*/
public JobStatus getJobStatus(JobID jobId) throws IOException, InterruptedException {
    try {
        Long delay = conf.getLong(HadoopJobProperty.JOB_STATUS_POLL_DELAY.propertyName(), -1);

        HadoopProtocolTaskArguments args = delay >= 0
                ? new HadoopProtocolTaskArguments(jobId.getJtIdentifier(), jobId.getId(), delay)
                : new HadoopProtocolTaskArguments(jobId.getJtIdentifier(), jobId.getId());

        HadoopJobStatus status = cli.compute().execute(HadoopProtocolJobStatusTask.class.getName(), args);

        if (status == null)
            throw new IOException("Job tracker doesn't have any information about the job: " + jobId);

        return processStatus(status);
    } catch (GridClientException e) {
        throw new IOException("Failed to get job status: " + jobId, e);
    }
}

From source file:org.apache.ignite.internal.processors.hadoop.proto.HadoopClientProtocol.java

License:Apache License

/** {@inheritDoc} */
@Override/*  w  ww  . j a  va  2 s .  co  m*/
public Counters getJobCounters(JobID jobId) throws IOException, InterruptedException {
    try {
        final HadoopCounters counters = cli.compute().execute(HadoopProtocolJobCountersTask.class.getName(),
                new HadoopProtocolTaskArguments(jobId.getJtIdentifier(), jobId.getId()));

        if (counters == null)
            throw new IOException("Job tracker doesn't have any information about the job: " + jobId);

        return new HadoopMapReduceCounters(counters);
    } catch (GridClientException e) {
        throw new IOException("Failed to get job counters: " + jobId, e);
    }
}

From source file:org.gridgain.client.hadoop.GridHadoopClientProtocol.java

License:Open Source License

/** {@inheritDoc} */
@Override//from ww  w  .j a  v  a2s .c o  m
public JobStatus submitJob(JobID jobId, String jobSubmitDir, Credentials ts)
        throws IOException, InterruptedException {
    try {
        conf.setLong(JOB_SUBMISSION_START_TS_PROPERTY, U.currentTimeMillis());

        GridHadoopJobStatus status = cli.compute().execute(GridHadoopProtocolSubmitJobTask.class.getName(),
                new GridHadoopProtocolTaskArguments(jobId.getJtIdentifier(), jobId.getId(),
                        createJobInfo(conf)));

        assert status != null;

        return processStatus(status);
    } catch (GridClientException | GridException e) {
        throw new IOException("Failed to submit job.", e);
    }
}