Skip navigation links

Oracle® Loader for Hadoop Java API Reference for Linux
Release 1.1

E20858-03


oracle.hadoop.loader.examples
Class AvroInputFormat

java.lang.Object
  extended by org.apache.hadoop.mapreduce.InputFormat<K,V>
      extended by org.apache.hadoop.mapreduce.lib.input.FileInputFormat<org.apache.avro.generic.IndexedRecord,org.apache.hadoop.io.NullWritable>
          extended by oracle.hadoop.loader.examples.AvroInputFormat


public class AvroInputFormat
extends org.apache.hadoop.mapreduce.lib.input.FileInputFormat<org.apache.avro.generic.IndexedRecord,org.apache.hadoop.io.NullWritable>

This is an implementation of org.apache.hadoop.mapreduce.InputFormat for Avro Record files for use with Oracle Loader for Hadoop.

To process only files with the .avro extension, you can append *.avro to each directory specified by the configuration property mapred.input.dir, or you can override FileInputFormat.listStatus().


Constructor Summary
AvroInputFormat()
           

 

Method Summary
 org.apache.hadoop.mapreduce.RecordReader<org.apache.avro.generic.IndexedRecord,org.apache.hadoop.io.NullWritable> createRecordReader(org.apache.hadoop.mapreduce.InputSplit split, org.apache.hadoop.mapreduce.TaskAttemptContext context)
          Create a record reader for Avro files for a given split.

 

Methods inherited from class org.apache.hadoop.mapreduce.lib.input.FileInputFormat
addInputPath, addInputPaths, getInputPathFilter, getInputPaths, getMaxSplitSize, getMinSplitSize, getSplits, setInputPathFilter, setInputPaths, setInputPaths, setMaxInputSplitSize, setMinInputSplitSize

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

AvroInputFormat

public AvroInputFormat()

Method Detail

createRecordReader

public org.apache.hadoop.mapreduce.RecordReader<org.apache.avro.generic.IndexedRecord,org.apache.hadoop.io.NullWritable> createRecordReader(org.apache.hadoop.mapreduce.InputSplit split,
                                                                                                                                            org.apache.hadoop.mapreduce.TaskAttemptContext context)
                                                                                                                                     throws java.io.IOException,
                                                                                                                                            java.lang.InterruptedException
Create a record reader for Avro files for a given split. The framework will call RecordReader.initialize(InputSplit, TaskAttemptContext) before the split is used.
Specified by:
createRecordReader in class org.apache.hadoop.mapreduce.InputFormat<org.apache.avro.generic.IndexedRecord,org.apache.hadoop.io.NullWritable>
Parameters:
split - the split to be read
context - the information about the task
Returns:
a new record reader
Throws:
java.io.IOException
java.lang.InterruptedException

Skip navigation links

Oracle® Loader for Hadoop Java API Reference for Linux
Release 1.1

E20858-03


Copyright © 2011, Oracle and/or its affiliates. All rights reserved.