Package org.apache.giraph.io.formats
Class TextEdgeInputFormat.TextEdgeReaderFromEachLineProcessed<T>
- 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.TextEdgeReaderFromEachLineProcessed<T>
-
- Type Parameters:
T
- The resulting type of preprocessing.
- 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:
DatagenEdgeInputFormat.LiveJournalEdgeReader
,LiveJournalEdgeInputFormat.LiveJournalEdgeReader
,P2PEdgeInputFormat.P2PEdgeReader
,P2PEdgeMultipleLongInputFormat.P2PEdgeReader
- Enclosing class:
- TextEdgeInputFormat<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>
protected abstract class TextEdgeInputFormat.TextEdgeReaderFromEachLineProcessed<T> extends TextEdgeInputFormat.TextEdgeReader
Abstract class to be implemented by the user to read an edge from each text line after preprocessing it.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TextEdgeReaderFromEachLineProcessed()
-
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(T line)
Reads source vertex id from the preprocessed line.protected abstract I
getTargetVertexId(T line)
Reads target vertex id from the preprocessed line.protected abstract E
getValue(T line)
Reads edge value from the preprocessed line.boolean
nextEdge()
protected abstract T
preprocessLine(org.apache.hadoop.io.Text line)
Preprocess the line so other methods can easily read necessary information for creating edge-
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 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
-
preprocessLine
protected abstract T preprocessLine(org.apache.hadoop.io.Text line) throws IOException
Preprocess the line so other methods can easily read necessary information for creating edge- Parameters:
line
- the current line to be read- Returns:
- the preprocessed object
- Throws:
IOException
- exception that can be thrown while reading
-
getTargetVertexId
protected abstract I getTargetVertexId(T line) throws IOException
Reads target vertex id from the preprocessed line.- Parameters:
line
- the object obtained by preprocessing the line- Returns:
- the target vertex id
- Throws:
IOException
- exception that can be thrown while reading
-
getSourceVertexId
protected abstract I getSourceVertexId(T line) throws IOException
Reads source vertex id from the preprocessed line.- Parameters:
line
- the object obtained by preprocessing the line- Returns:
- the source vertex id
- Throws:
IOException
- exception that can be thrown while reading
-
getValue
protected abstract E getValue(T line) throws IOException
Reads edge value from the preprocessed line.- Parameters:
line
- the object obtained by preprocessing the line- Returns:
- the edge value
- Throws:
IOException
- exception that can be thrown while reading
-
-