Example usage for org.apache.hadoop.mapreduce.task TaskAttemptContextImpl TaskAttemptContextImpl

List of usage examples for org.apache.hadoop.mapreduce.task TaskAttemptContextImpl TaskAttemptContextImpl

Introduction

In this page you can find the example usage for org.apache.hadoop.mapreduce.task TaskAttemptContextImpl TaskAttemptContextImpl.

Prototype

public TaskAttemptContextImpl(Configuration conf, TaskAttemptID taskId, StatusReporter reporter) 

Source Link

Usage

From source file:co.cask.cdap.internal.app.runtime.batch.dataset.output.MultipleOutputs.java

License:Apache License

static TaskAttemptContext getNamedTaskContext(TaskAttemptContext context, String namedOutput)
        throws IOException {
    Job job = getNamedJob(context, namedOutput);
    return new TaskAttemptContextImpl(job.getConfiguration(), context.getTaskAttemptID(),
            new WrappedStatusReporter(context));
}

From source file:com.telefonica.iot.tidoop.apiext.hadoop.ckan.CKANInputFormatTest.java

License:Open Source License

/**
 * Test of createRecordReader method, of class CKANInputFormat.
 *//* w w  w .j a v  a  2  s . c  o m*/
@Test
public void testCreateRecordReader() {
    System.out.println("Testing CKANInputFormat.createRecordReader)");
    job.setInputFormatClass(CKANInputFormat.class);
    CKANInputFormat.setEnvironment(job, ckanHost, ckanPort, enableSSL, ckanAPIKey);
    CKANInputFormat.setInput(job, ckanInputRes);
    CKANInputFormat.setSplitsLength(job, splitsLength);
    CKANInputFormat inputFormat = new CKANInputFormat();
    RecordReader recordReader = inputFormat.createRecordReader(new CKANInputSplit(resId, 0, 1000),
            new TaskAttemptContextImpl(job.getConfiguration(), new TaskAttemptID(), null));
    assertTrue(recordReader != null);
}

From source file:com.telefonica.iot.tidoop.apiext.hadoop.ckan.CKANOutputFormatTest.java

License:Open Source License

/**
 * Test of getRecordWriter method, of class CKANOutputFormat.
 *///w  w w .ja v  a2 s  .com
@Test
public void testGetRecordWriter() {
    System.out.println("Testing CKANOutputFormat.getRecordWriter)");
    job.setOutputFormatClass(CKANOutputFormat.class);
    CKANOutputFormat.setEnvironment(job, ckanHost, ckanPort, enableSSL, ckanAPIKey);
    CKANOutputFormat.setOutputPkg(job, ckanOutputRes);
    CKANOutputFormat outputFormat = new CKANOutputFormat();
    RecordWriter recordWriter = null;

    try {
        recordWriter = outputFormat
                .getRecordWriter(new TaskAttemptContextImpl(job.getConfiguration(), new TaskAttemptID(), null));
    } catch (IOException e) {
        fail(e.getMessage());
    } catch (InterruptedException e) {
        fail(e.getMessage());
    } // try catch

    assertTrue(recordWriter != null);
}

From source file:com.telefonica.iot.tidoop.apiext.hadoop.ckan.CKANOutputFormatTest.java

License:Open Source License

/**
 * Test of checkOutputSpecs method, of class CKANOutputFormat.
 *///w  w  w  .j  a v  a  2s. c  o m
@Test
public void testCheckOutputSpecs() {
    System.out.println("Testing CKANOutputFormat.checkOutputSpecs");

    try {
        CKANOutputFormat outputFormat = new CKANOutputFormat();
        outputFormat.getOutputCommitter(
                new TaskAttemptContextImpl(job.getConfiguration(), new TaskAttemptID(), null));
        assertTrue(true);
    } catch (IOException e) {
        fail(e.getMessage());
    } catch (InterruptedException e) {
        fail(e.getMessage());
    } // try catch
}

From source file:com.telefonica.iot.tidoop.apiext.hadoop.ckan.CKANOutputFormatTest.java

License:Open Source License

/**
 * Test of getOutputCommitter method, of class CKANOutputFormat.
 *//*w ww . j  a  va2s. c o  m*/
@Test
public void testGetOutputCommitter() {
    System.out.println("Testing CKANOutputFormat.getOutputCommitter");

    try {
        CKANOutputFormat outputFormat = new CKANOutputFormat();
        outputFormat.getOutputCommitter(
                new TaskAttemptContextImpl(job.getConfiguration(), new TaskAttemptID(), null));
        assertTrue(true);
    } catch (IOException e) {
        fail(e.getMessage());
    } catch (InterruptedException e) {
        fail(e.getMessage());
    } // try catch
}