Example usage for org.apache.hadoop.mapreduce.protocol ClientProtocol getJobCounters

List of usage examples for org.apache.hadoop.mapreduce.protocol ClientProtocol getJobCounters

Introduction

In this page you can find the example usage for org.apache.hadoop.mapreduce.protocol ClientProtocol getJobCounters.

Prototype

public Counters getJobCounters(JobID jobid) throws IOException, InterruptedException;

Source Link

Document

Grab the current job counters

Usage

From source file:org.apache.ignite.client.hadoop.GridHadoopClientProtocolSelfTest.java

License:Apache License

/**
 * Tests job counters retrieval for unknown job id.
 *
 * @throws Exception If failed.//from  w  w  w  .j  a v  a 2s .com
 */
private void tstUnknownJobCounters() throws Exception {
    GridHadoopClientProtocolProvider provider = provider();

    ClientProtocol proto = provider.create(config(GridHadoopAbstractSelfTest.REST_PORT));

    try {
        proto.getJobCounters(new JobID(UUID.randomUUID().toString(), -1));
        fail("exception must be thrown");
    } catch (Exception e) {
        assert e instanceof IOException : "wrong error has been thrown";
    }
}

From source file:org.apache.ignite.client.hadoop.HadoopClientProtocolSelfTest.java

License:Apache License

/**
 * Tests job counters retrieval for unknown job id.
 *
 * @throws Exception If failed.//from  ww w.  ja  v a 2s  . c  o  m
 */
private void tstUnknownJobCounters() throws Exception {
    IgniteHadoopClientProtocolProvider provider = provider();

    ClientProtocol proto = provider.create(config(HadoopAbstractSelfTest.REST_PORT));

    try {
        proto.getJobCounters(new JobID(UUID.randomUUID().toString(), -1));
        fail("exception must be thrown");
    } catch (Exception e) {
        assert e instanceof IOException : "wrong error has been thrown";
    }
}