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

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

Introduction

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

Prototype

public String getJtIdentifier() 

Source Link

Usage

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

License:Apache License

/** {@inheritDoc} */
@Override// ww  w  .  jav  a  2s .  co m
public void killJob(JobID jobId) throws IOException, InterruptedException {
    try {
        execute(HadoopProtocolKillJobTask.class, 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.impl.proto.HadoopClientProtocol.java

License:Apache License

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

        HadoopJobStatus status;

        if (delay >= 0)
            status = execute(HadoopProtocolJobStatusTask.class, jobId.getJtIdentifier(), jobId.getId(), delay);
        else
            status = execute(HadoopProtocolJobStatusTask.class, jobId.getJtIdentifier(), jobId.getId());

        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.impl.proto.HadoopClientProtocol.java

License:Apache License

/** {@inheritDoc} */
@Override/*from ww  w.j a v a  2  s  . co m*/
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//from  ww w.  ja  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 ww . j  av  a  2  s  .c  om*/
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 . co  m
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  w w  . ja  v  a  2  s  .  c o 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  w  w  w. ja v  a  2 s .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);
    }
}