Package org.apache.giraph.io.formats
Class TextEdgeInputFormat.TextEdgeReader
- java.lang.Object
-
- org.apache.giraph.conf.DefaultImmutableClassesGiraphConfigurable<I,V,E>
-
- org.apache.giraph.worker.WorkerAggregatorDelegator<I,org.apache.hadoop.io.Writable,E>
-
- org.apache.giraph.io.EdgeReader<I,E>
-
- org.apache.giraph.io.formats.TextEdgeInputFormat.TextEdgeReader
-
- All Implemented Interfaces:
org.apache.giraph.aggregators.AggregatorUsage
,org.apache.giraph.conf.GiraphConfigurationSettable<I,org.apache.hadoop.io.Writable,E>
,org.apache.giraph.conf.ImmutableClassesGiraphConfigurable<I,org.apache.hadoop.io.Writable,E>
,org.apache.giraph.worker.WorkerAggregatorUsage
,org.apache.giraph.worker.WorkerBroadcastUsage
,org.apache.giraph.worker.WorkerGlobalCommUsage
,org.apache.giraph.worker.WorkerReduceUsage
- Direct Known Subclasses:
TextEdgeInputFormat.TextEdgeReaderFromEachLine
,TextEdgeInputFormat.TextEdgeReaderFromEachLineProcessed
- Enclosing class:
- TextEdgeInputFormat<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>
protected abstract class TextEdgeInputFormat.TextEdgeReader extends org.apache.giraph.io.EdgeReader<I,E>
EdgeReader
forTextEdgeInputFormat
.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TextEdgeReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
createLineRecordReader(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context)
Create the line record reader.protected org.apache.hadoop.mapreduce.TaskAttemptContext
getContext()
Get the context.float
getProgress()
protected org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
getRecordReader()
Get the line record reader.void
initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context)
-
Methods inherited from class org.apache.giraph.io.EdgeReader
getCurrentEdge, getCurrentSourceId, nextEdge
-
Methods inherited from class org.apache.giraph.worker.WorkerAggregatorDelegator
aggregate, getAggregatedValue, getBroadcast, reduce, reduceMerge, setAggregatorManager
-
-
-
-
Method Detail
-
initialize
public void initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException, InterruptedException
- Specified by:
initialize
in classorg.apache.giraph.io.EdgeReader<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
-
createLineRecordReader
protected org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text> createLineRecordReader(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException, InterruptedException
Create the line record reader. Override this to use a different underlying record reader (useful for testing).- Parameters:
inputSplit
- the split to readcontext
- the context passed to initialize- Returns:
- the record reader to be used
- Throws:
IOException
- exception that can be thrown during creationInterruptedException
- exception that can be thrown during creation
-
close
public void close() throws IOException
- Specified by:
close
in classorg.apache.giraph.io.EdgeReader<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>
- Throws:
IOException
-
getProgress
public float getProgress() throws IOException, InterruptedException
- Specified by:
getProgress
in classorg.apache.giraph.io.EdgeReader<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
-
getRecordReader
protected org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text> getRecordReader()
Get the line record reader.- Returns:
- Record reader to be used for reading.
-
getContext
protected org.apache.hadoop.mapreduce.TaskAttemptContext getContext()
Get the context.- Returns:
- Context passed to initialize.
-
-