/**
  * Constructs the DelegatingRecordReader.
  *
  * @param split TaggegInputSplit object
  * @param context TaskAttemptContext object
  * @throws IOException
  * @throws InterruptedException
  */
 @SuppressWarnings("unchecked")
 public DelegatingRecordReader(InputSplit split, TaskAttemptContext context)
     throws IOException, InterruptedException {
   // Find the InputFormat and then the RecordReader from the
   // TaggedInputSplit.
   TaggedInputSplit taggedInputSplit = (TaggedInputSplit) split;
   InputFormat<K, V> inputFormat =
       (InputFormat<K, V>)
           DCUtils.loadSerializedObjectInDC(
               context.getConfiguration(),
               InputFormat.class,
               taggedInputSplit.getInputFormatFile(),
               true);
   originalRR = inputFormat.createRecordReader(taggedInputSplit.getInputSplit(), context);
 }
Esempio n. 2
0
 @SuppressWarnings("unchecked")
 private void initHandlerContextAndCollector(Context context)
     throws IOException, InterruptedException, TupleMRException {
   String fileName = context.getConfiguration().get(SimpleReducer.CONF_REDUCER_HANDLER);
   handler =
       DCUtils.loadSerializedObjectInDC(
           context.getConfiguration(), TupleRollupReducer.class, fileName, true);
   collector =
       handler
       .new Collector((ReduceContext<DatumWrapper<ITuple>, NullWritable, Object, Object>) context);
   this.context =
       new TupleMRContext(
           (ReduceContext<DatumWrapper<ITuple>, NullWritable, Object, Object>) context,
           tupleMRConfig);
   handler.setup(this.context, collector);
 }