Package org.apache.giraph.io.formats
Class TextVertexInputFormat.TextVertexReaderFromEachLine
- 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.TextVertexReaderFromEachLine
-
- 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
- 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.TextVertexReaderFromEachLine extends TextVertexInputFormat.TextVertexReader
Abstract class to be implemented by the user to read a vertex from each text line.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTextVertexReaderFromEachLine()
-
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(org.apache.hadoop.io.Text line)Reads edges value from the current line.protected abstract IgetId(org.apache.hadoop.io.Text line)Reads vertex id from the current line.protected abstract VgetValue(org.apache.hadoop.io.Text line)Reads vertex value from the current line.booleannextVertex()-
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
-
getCurrentVertex
public final org.apache.giraph.graph.Vertex<I,V,E> getCurrentVertex() throws IOException, InterruptedException
- Specified by:
getCurrentVertexin 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:
IOExceptionInterruptedException
-
nextVertex
public final boolean nextVertex() throws IOException, InterruptedException- Specified by:
nextVertexin 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:
IOExceptionInterruptedException
-
getId
protected abstract I getId(org.apache.hadoop.io.Text line) throws IOException
Reads vertex id from the current line.- Parameters:
line- the current line- Returns:
- the vertex id corresponding to the line
- Throws:
IOException- exception that can be thrown while reading
-
getValue
protected abstract V getValue(org.apache.hadoop.io.Text line) throws IOException
Reads vertex value from the current line.- Parameters:
line- the current line- Returns:
- the vertex value corresponding to the line
- Throws:
IOException- exception that can be thrown while reading
-
getEdges
protected abstract Iterable<org.apache.giraph.edge.Edge<I,E>> getEdges(org.apache.hadoop.io.Text line) throws IOException
Reads edges value from the current line.- Parameters:
line- the current line- Returns:
- the edges
- Throws:
IOException- exception that can be thrown while reading
-
-