Package org.apache.giraph.io.formats
Class TextEdgeInputFormat.TextEdgeReaderFromEachLine
- 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
-
- org.apache.giraph.io.formats.TextEdgeInputFormat.TextEdgeReaderFromEachLine
-
- 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
- Enclosing class:
- TextEdgeInputFormat<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>
protected abstract class TextEdgeInputFormat.TextEdgeReaderFromEachLine extends TextEdgeInputFormat.TextEdgeReader
Abstract class to be implemented by the user to read an edge from each text line.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TextEdgeReaderFromEachLine()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.apache.giraph.edge.Edge<I,E>
getCurrentEdge()
I
getCurrentSourceId()
protected abstract I
getSourceVertexId(org.apache.hadoop.io.Text line)
Reads source vertex id from the current line.protected abstract I
getTargetVertexId(org.apache.hadoop.io.Text line)
Reads target vertex id from the current line.protected abstract E
getValue(org.apache.hadoop.io.Text line)
Reads edge value from the current line.boolean
nextEdge()
-
Methods inherited from class org.apache.giraph.io.formats.TextEdgeInputFormat.TextEdgeReader
close, createLineRecordReader, getContext, getProgress, getRecordReader, initialize
-
Methods inherited from class org.apache.giraph.worker.WorkerAggregatorDelegator
aggregate, getAggregatedValue, getBroadcast, reduce, reduceMerge, setAggregatorManager
-
-
-
-
Method Detail
-
getCurrentSourceId
public final I getCurrentSourceId() throws IOException, InterruptedException
- Specified by:
getCurrentSourceId
in classorg.apache.giraph.io.EdgeReader<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
-
getCurrentEdge
public final org.apache.giraph.edge.Edge<I,E> getCurrentEdge() throws IOException, InterruptedException
- Specified by:
getCurrentEdge
in classorg.apache.giraph.io.EdgeReader<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
-
nextEdge
public final boolean nextEdge() throws IOException, InterruptedException
- Specified by:
nextEdge
in classorg.apache.giraph.io.EdgeReader<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
-
getSourceVertexId
protected abstract I getSourceVertexId(org.apache.hadoop.io.Text line) throws IOException
Reads source vertex id from the current line.- Parameters:
line
- the current line- Returns:
- the source vertex id corresponding to the line
- Throws:
IOException
- exception that can be thrown while reading
-
getTargetVertexId
protected abstract I getTargetVertexId(org.apache.hadoop.io.Text line) throws IOException
Reads target vertex id from the current line.- Parameters:
line
- the current line- Returns:
- the target vertex id corresponding to the line
- Throws:
IOException
- exception that can be thrown while reading
-
getValue
protected abstract E getValue(org.apache.hadoop.io.Text line) throws IOException
Reads edge value from the current line.- Parameters:
line
- the current line- Returns:
- the edge value corresponding to the line
- Throws:
IOException
- exception that can be thrown while reading
-
-