Example usage for org.apache.hadoop.mapred TaskAttemptContext getConfiguration

List of usage examples for org.apache.hadoop.mapred TaskAttemptContext getConfiguration

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred TaskAttemptContext getConfiguration.

Prototype

public Configuration getConfiguration();

Source Link

Document

Return the configuration for the job.

Usage

From source file:com.vertica.hivestoragehandler.VerticaOutputFormat.java

License:Apache License

/** {@inheritDoc} */
public RecordWriter<Text, VerticaRecord> getRecordWriter(TaskAttemptContext context) throws IOException {

    VerticaConfiguration config = new VerticaConfiguration(context.getConfiguration());

    String name = context.getJobName();
    String table = config.getOutputTableName();
    try {/*from  w  w w  .j  a  v  a  2s .  c  o  m*/
        return new VerticaRecordWriter(getConnection(context.getConfiguration()), table, config.getBatchSize());
    } catch (SQLException e) {
        throw new IOException(e);
    }
}

From source file:com.vertica.hivestoragehandler.VerticaOutputFormat.java

License:Apache License

/** (@inheritDoc) */
public OutputCommitter getOutputCommitter(TaskAttemptContext context) throws IOException, InterruptedException {

    VerticaConfiguration config = new VerticaConfiguration(context.getConfiguration());

    try {/*from w w w. j  a v  a 2 s.  co m*/
        Class outputCommitterClass = config.getOutputCommitterClass();
        LOG.info("Initializing OutputCommitter class " + outputCommitterClass.getCanonicalName());
        return initializeOutputCommitter(outputCommitterClass, context.getConfiguration());
    } catch (ClassNotFoundException e) {
        throw new IOException("Could not find OutputCommitter class confiugured as "
                + VerticaConfiguration.OUTPUT_COMMITTER_CLASS_PARAM, e);
    }
}

From source file:org.apache.hive.hcatalog.mapreduce.HCatMapRedUtil.java

License:Apache License

public static TaskAttemptContext createTaskAttemptContext(
        org.apache.hadoop.mapreduce.TaskAttemptContext context) {
    return createTaskAttemptContext(new JobConf(context.getConfiguration()),
            org.apache.hadoop.mapred.TaskAttemptID.forName(context.getTaskAttemptID().toString()),
            Reporter.NULL);/*from  w  w w  .j  av a  2s  .  co m*/
}