/** * 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>) ReflectionUtils .newInstance(taggedInputSplit.getInputFormatClass(), context .getConfiguration()); originalRR = inputFormat.createRecordReader(taggedInputSplit .getInputSplit(), context); }
@SuppressWarnings("unchecked") protected void setup(Context context) throws IOException, InterruptedException { // Find the Mapper from the TaggedInputSplit. TaggedInputSplit inputSplit = (TaggedInputSplit) context.getInputSplit(); mapper = (Mapper<K1, V1, K2, V2>) ReflectionUtils.newInstance(inputSplit .getMapperClass(), context.getConfiguration()); }
@SuppressWarnings("unchecked") public void readFields(DataInput in) throws IOException { inputSplitClass = (Class<? extends InputSplit>) readClass(in); inputFormatClass = (Class<? extends InputFormat<?, ?>>) readClass(in); mapperClass = (Class<? extends Mapper<?, ?, ?, ?>>) readClass(in); inputSplit = (InputSplit) ReflectionUtils .newInstance(inputSplitClass, conf); SerializationFactory factory = new SerializationFactory(conf); Deserializer deserializer = factory.getDeserializer(inputSplitClass); deserializer.open((DataInputStream)in); inputSplit = (InputSplit)deserializer.deserialize(inputSplit); }
int index = -1; if (tis.getInputFormatClass().equals(KeyValueTextInputFormat.class)) { } else if (tis.getMapperClass().equals(MapClass.class)) {
@Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { originalRR.initialize(((TaggedInputSplit) split).getInputSplit(), context); }
splits.add(new TaggedInputSplit(pathSplit, conf, format.getClass(), mapperClass));
int index = -1; if (tis.getInputFormatClass().equals(KeyValueTextInputFormat.class)) { } else if (tis.getMapperClass().equals(MapClass.class)) {
@Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { originalRR.initialize(((TaggedInputSplit) split).getInputSplit(), context); }
splits.add(new TaggedInputSplit(pathSplit, conf, format.getClass(), mapperClass));
/** * 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>) ReflectionUtils .newInstance(taggedInputSplit.getInputFormatClass(), context .getConfiguration()); originalRR = inputFormat.createRecordReader(taggedInputSplit .getInputSplit(), context); }
@SuppressWarnings("unchecked") protected void setup(Context context) throws IOException, InterruptedException { // Find the Mapper from the TaggedInputSplit. TaggedInputSplit inputSplit = (TaggedInputSplit) context.getInputSplit(); mapper = (Mapper<K1, V1, K2, V2>) ReflectionUtils.newInstance(inputSplit .getMapperClass(), context.getConfiguration()); }
@SuppressWarnings("unchecked") public void readFields(DataInput in) throws IOException { inputSplitClass = (Class<? extends InputSplit>) readClass(in); inputFormatClass = (Class<? extends InputFormat<?, ?>>) readClass(in); mapperClass = (Class<? extends Mapper<?, ?, ?, ?>>) readClass(in); inputSplit = (InputSplit) ReflectionUtils .newInstance(inputSplitClass, conf); SerializationFactory factory = new SerializationFactory(conf); Deserializer deserializer = factory.getDeserializer(inputSplitClass); deserializer.open((DataInputStream)in); inputSplit = (InputSplit)deserializer.deserialize(inputSplit); }
@Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { originalRR.initialize(((TaggedInputSplit) split).getInputSplit(), context); }
splits.add(new TaggedInputSplit(pathSplit, conf, format.getClass(), mapperClass));
/** * 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>) ReflectionUtils .newInstance(taggedInputSplit.getInputFormatClass(), context .getConfiguration()); originalRR = inputFormat.createRecordReader(taggedInputSplit .getInputSplit(), context); }
@SuppressWarnings("unchecked") protected void setup(Context context) throws IOException, InterruptedException { // Find the Mapper from the TaggedInputSplit. TaggedInputSplit inputSplit = (TaggedInputSplit) context.getInputSplit(); mapper = (Mapper<K1, V1, K2, V2>) ReflectionUtils.newInstance(inputSplit .getMapperClass(), context.getConfiguration()); }
@SuppressWarnings("unchecked") public void readFields(DataInput in) throws IOException { inputSplitClass = (Class<? extends InputSplit>) readClass(in); inputFormatClass = (Class<? extends InputFormat<?, ?>>) readClass(in); mapperClass = (Class<? extends Mapper<?, ?, ?, ?>>) readClass(in); inputSplit = (InputSplit) ReflectionUtils .newInstance(inputSplitClass, conf); SerializationFactory factory = new SerializationFactory(conf); Deserializer deserializer = factory.getDeserializer(inputSplitClass); deserializer.open((DataInputStream)in); inputSplit = (InputSplit)deserializer.deserialize(inputSplit); }
@Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { originalRR.initialize(((TaggedInputSplit) split).getInputSplit(), context); }
splits.add(new TaggedInputSplit(pathSplit, conf, format.getClass(), mapperClass));
/** * 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>) ReflectionUtils .newInstance(taggedInputSplit.getInputFormatClass(), context .getConfiguration()); originalRR = inputFormat.createRecordReader(taggedInputSplit .getInputSplit(), context); }