Search in sources :

Example 1 with IgniteHadoopClientProtocolProvider

use of org.apache.ignite.hadoop.mapreduce.IgniteHadoopClientProtocolProvider in project ignite by apache.

the class HadoopClientProtocolSelfTest method tstUnknownJobCounters.

/**
     * Tests job counters retrieval for unknown job id.
     *
     * @throws Exception If failed.
     */
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";
    }
}
Also used : IgniteHadoopClientProtocolProvider(org.apache.ignite.hadoop.mapreduce.IgniteHadoopClientProtocolProvider) IOException(java.io.IOException) ClientProtocol(org.apache.hadoop.mapreduce.protocol.ClientProtocol) JobID(org.apache.hadoop.mapreduce.JobID) IOException(java.io.IOException)

Example 2 with IgniteHadoopClientProtocolProvider

use of org.apache.ignite.hadoop.mapreduce.IgniteHadoopClientProtocolProvider in project ignite by apache.

the class HadoopClientProtocolSelfTest method tstNextJobId.

/**
     * Test next job ID generation.
     *
     * @throws Exception If failed.
     */
@SuppressWarnings("ConstantConditions")
private void tstNextJobId() throws Exception {
    IgniteHadoopClientProtocolProvider provider = provider();
    ClientProtocol proto = provider.create(config(HadoopAbstractSelfTest.REST_PORT));
    JobID jobId = proto.getNewJobID();
    assert jobId != null;
    assert jobId.getJtIdentifier() != null;
    JobID nextJobId = proto.getNewJobID();
    assert nextJobId != null;
    assert nextJobId.getJtIdentifier() != null;
    assert !F.eq(jobId, nextJobId);
}
Also used : IgniteHadoopClientProtocolProvider(org.apache.ignite.hadoop.mapreduce.IgniteHadoopClientProtocolProvider) ClientProtocol(org.apache.hadoop.mapreduce.protocol.ClientProtocol) JobID(org.apache.hadoop.mapreduce.JobID)

Aggregations

JobID (org.apache.hadoop.mapreduce.JobID)2 ClientProtocol (org.apache.hadoop.mapreduce.protocol.ClientProtocol)2 IgniteHadoopClientProtocolProvider (org.apache.ignite.hadoop.mapreduce.IgniteHadoopClientProtocolProvider)2 IOException (java.io.IOException)1