List of usage examples for org.apache.hadoop.mapreduce TaskAttemptContext getCredentials
public Credentials getCredentials();
From source file:com.cloudera.recordservice.hcatalog.mapreduce.HCatRecordReader.java
License:Apache License
private RecordReader<NullWritable, RecordServiceRecord> createBaseRecordReader( RecordServiceInputSplit recordServiceSplit, TaskAttemptContext taskContext) throws IOException { JobConf jobConf = HCatUtil.getJobConfFromContext(taskContext); HCatRSUtil.copyCredentialsToJobConf(taskContext.getCredentials(), jobConf); return new RecordServiceInputFormat().createRecordReader(recordServiceSplit, taskContext); }
From source file:com.cloudera.recordservice.hcatalog.mapreduce.HCatRSBaseInputFormat.java
License:Apache License
/** * Create the RecordReader for the given InputSplit. Returns the underlying * RecordReader if the required operations are supported and schema matches * with HCatTable schema. Returns an HCatRecordReader if operations need to * be implemented in HCat.//from w w w.ja va2 s . c o m * @param split the split * @param taskContext the task attempt context * @return the record reader instance, either an HCatRecordReader(later) or * the underlying storage handler's RecordReader * @throws IOException or InterruptedException */ @Override public RecordReader<WritableComparable, RecordServiceRecord> createRecordReader(InputSplit split, TaskAttemptContext taskContext) throws IOException, InterruptedException { JobConf jobConf = HCatUtil.getJobConfFromContext(taskContext); HCatRSUtil.copyCredentialsToJobConf(taskContext.getCredentials(), jobConf); return new HCatRecordReader(); }