Package org.apache.giraph.io.formats
Class TextVertexInputFormat.TextVertexReaderFromEachLineProcessed<T>
- java.lang.Object
-
- org.apache.giraph.conf.DefaultImmutableClassesGiraphConfigurable<I,V,E>
-
- org.apache.giraph.worker.WorkerAggregatorDelegator<I,V,E>
-
- org.apache.giraph.io.VertexReader<I,V,E>
-
- org.apache.giraph.io.formats.TextVertexInputFormat.TextVertexReader
-
- org.apache.giraph.io.formats.TextVertexInputFormat.TextVertexReaderFromEachLineProcessed<T>
-
- Type Parameters:
T
- The resulting type of preprocessing.
- All Implemented Interfaces:
org.apache.giraph.aggregators.AggregatorUsage
,org.apache.giraph.conf.GiraphConfigurationSettable<I,V,E>
,org.apache.giraph.conf.ImmutableClassesGiraphConfigurable<I,V,E>
,org.apache.giraph.worker.WorkerAggregatorUsage
,org.apache.giraph.worker.WorkerBroadcastUsage
,org.apache.giraph.worker.WorkerGlobalCommUsage
,org.apache.giraph.worker.WorkerReduceUsage
- Direct Known Subclasses:
CircleVertexInputFormat.P2PVertexReader
,DatagenVertexInputFormat.P2PVertexReader
,LiveJournalVertexInputFormat.LiveJournalVertexReader
,P2PVertexInputFormat.P2PVertexReader
,P2PVertexMultipleLongInputFormat.P2PVertexReader
,SampleTextVertexInputFormat.LongLongNullVertexReader
- Enclosing class:
- TextVertexInputFormat<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
protected abstract class TextVertexInputFormat.TextVertexReaderFromEachLineProcessed<T> extends TextVertexInputFormat.TextVertexReader
Abstract class to be implemented by the user to read a vertex from each text line after preprocessing it.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TextVertexReaderFromEachLineProcessed()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.apache.giraph.graph.Vertex<I,V,E>
getCurrentVertex()
protected abstract Iterable<org.apache.giraph.edge.Edge<I,E>>
getEdges(T line)
Reads edges from the preprocessed line.protected abstract I
getId(T line)
Reads vertex id from the preprocessed line.protected abstract V
getValue(T line)
Reads vertex value from the preprocessed line.boolean
nextVertex()
protected abstract T
preprocessLine(org.apache.hadoop.io.Text line)
Preprocess the line so other methods can easily read necessary information for creating vertex.-
Methods inherited from class org.apache.giraph.io.formats.TextVertexInputFormat.TextVertexReader
close, createLineRecordReader, getContext, getProgress, getRecordReader, initialize
-
Methods inherited from class org.apache.giraph.worker.WorkerAggregatorDelegator
aggregate, getAggregatedValue, getBroadcast, reduce, reduceMerge, setAggregatorManager
-
-
-
-
Method Detail
-
nextVertex
public final boolean nextVertex() throws IOException, InterruptedException
- Specified by:
nextVertex
in classorg.apache.giraph.io.VertexReader<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
-
getCurrentVertex
public final org.apache.giraph.graph.Vertex<I,V,E> getCurrentVertex() throws IOException, InterruptedException
- Specified by:
getCurrentVertex
in classorg.apache.giraph.io.VertexReader<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,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 vertex.- Parameters:
line
- the current line to be read- Returns:
- the preprocessed object
- Throws:
IOException
- exception that can be thrown while reading
-
getId
protected abstract I getId(T line) throws IOException
Reads vertex id from the preprocessed line.- Parameters:
line
- the object obtained by preprocessing the line- Returns:
- the vertex id
- Throws:
IOException
- exception that can be thrown while reading
-
getValue
protected abstract V getValue(T line) throws IOException
Reads vertex value from the preprocessed line.- Parameters:
line
- the object obtained by preprocessing the line- Returns:
- the vertex value
- Throws:
IOException
- exception that can be thrown while reading
-
getEdges
protected abstract Iterable<org.apache.giraph.edge.Edge<I,E>> getEdges(T line) throws IOException
Reads edges from the preprocessed line.- Parameters:
line
- the object obtained by preprocessing the line- Returns:
- the edges
- Throws:
IOException
- exception that can be thrown while reading
-
-