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

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

Introduction

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

Prototype

public String getJobName();

Source Link

Document

Get the user-specified job name.

Usage

From source file:com.asakusafw.runtime.stage.output.LegacyBridgeOutputCommitter.java

License:Apache License

private void logTask(TaskAttemptContext taskContext) {
    if (LOG.isInfoEnabled()) {
        LOG.info(MessageFormat.format("Old-style output committer is used in the task: {0} ({1})",
                taskContext.getJobName(), taskContext.getTaskAttemptID()));
    }/*  w  w w.ja  v  a 2  s.  co  m*/
}

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  av a  2 s  .  c o  m
        return new VerticaRecordWriter(getConnection(context.getConfiguration()), table, config.getBatchSize());
    } catch (SQLException e) {
        throw new IOException(e);
    }
}