Class P2PVertexInputFormat.P2PVertexReader
- 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<String[]>
-
- com.alibaba.graphscope.example.giraph.format.P2PVertexInputFormat.P2PVertexReader
-
- All Implemented Interfaces:
org.apache.giraph.aggregators.AggregatorUsage
,org.apache.giraph.conf.GiraphConfigurationSettable<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.LongWritable>
,org.apache.giraph.conf.ImmutableClassesGiraphConfigurable<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.LongWritable>
,org.apache.giraph.worker.WorkerAggregatorUsage
,org.apache.giraph.worker.WorkerBroadcastUsage
,org.apache.giraph.worker.WorkerGlobalCommUsage
,org.apache.giraph.worker.WorkerReduceUsage
- Enclosing class:
- P2PVertexInputFormat
public class P2PVertexInputFormat.P2PVertexReader extends TextVertexInputFormat.TextVertexReaderFromEachLineProcessed<String[]>
-
-
Constructor Summary
Constructors Constructor Description P2PVertexReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Iterable<org.apache.giraph.edge.Edge<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.LongWritable>>
getEdges(String[] tokens)
Reads edges from the preprocessed line.protected org.apache.hadoop.io.LongWritable
getId(String[] tokens)
Reads vertex id from the preprocessed line.protected org.apache.hadoop.io.LongWritable
getValue(String[] tokens)
Reads vertex value from the preprocessed line.protected String[]
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.TextVertexReaderFromEachLineProcessed
getCurrentVertex, nextVertex
-
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
-
preprocessLine
protected String[] preprocessLine(org.apache.hadoop.io.Text line) throws IOException
Description copied from class:TextVertexInputFormat.TextVertexReaderFromEachLineProcessed
Preprocess the line so other methods can easily read necessary information for creating vertex.- Specified by:
preprocessLine
in classTextVertexInputFormat.TextVertexReaderFromEachLineProcessed<String[]>
- Parameters:
line
- the current line to be read- Returns:
- the preprocessed object
- Throws:
IOException
- exception that can be thrown while reading
-
getId
protected org.apache.hadoop.io.LongWritable getId(String[] tokens) throws IOException
Description copied from class:TextVertexInputFormat.TextVertexReaderFromEachLineProcessed
Reads vertex id from the preprocessed line.- Specified by:
getId
in classTextVertexInputFormat.TextVertexReaderFromEachLineProcessed<String[]>
- Parameters:
tokens
- the object obtained by preprocessing the line- Returns:
- the vertex id
- Throws:
IOException
- exception that can be thrown while reading
-
getValue
protected org.apache.hadoop.io.LongWritable getValue(String[] tokens) throws IOException
Description copied from class:TextVertexInputFormat.TextVertexReaderFromEachLineProcessed
Reads vertex value from the preprocessed line.- Specified by:
getValue
in classTextVertexInputFormat.TextVertexReaderFromEachLineProcessed<String[]>
- Parameters:
tokens
- the object obtained by preprocessing the line- Returns:
- the vertex value
- Throws:
IOException
- exception that can be thrown while reading
-
getEdges
protected Iterable<org.apache.giraph.edge.Edge<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.LongWritable>> getEdges(String[] tokens) throws IOException
Description copied from class:TextVertexInputFormat.TextVertexReaderFromEachLineProcessed
Reads edges from the preprocessed line.- Specified by:
getEdges
in classTextVertexInputFormat.TextVertexReaderFromEachLineProcessed<String[]>
- Parameters:
tokens
- the object obtained by preprocessing the line- Returns:
- the edges
- Throws:
IOException
- exception that can be thrown while reading
-
-