Class P2PVertexMultipleLongInputFormat.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.P2PVertexMultipleLongInputFormat.P2PVertexReader
-
- All Implemented Interfaces:
org.apache.giraph.aggregators.AggregatorUsage,org.apache.giraph.conf.GiraphConfigurationSettable<org.apache.hadoop.io.LongWritable,MultipleLongWritable,MultipleLongWritable>,org.apache.giraph.conf.ImmutableClassesGiraphConfigurable<org.apache.hadoop.io.LongWritable,MultipleLongWritable,MultipleLongWritable>,org.apache.giraph.worker.WorkerAggregatorUsage,org.apache.giraph.worker.WorkerBroadcastUsage,org.apache.giraph.worker.WorkerGlobalCommUsage,org.apache.giraph.worker.WorkerReduceUsage
- Enclosing class:
- P2PVertexMultipleLongInputFormat
public class P2PVertexMultipleLongInputFormat.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,MultipleLongWritable>>getEdges(String[] tokens)Reads edges from the preprocessed line.protected org.apache.hadoop.io.LongWritablegetId(String[] tokens)Reads vertex id from the preprocessed line.protected MultipleLongWritablegetValue(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.TextVertexReaderFromEachLineProcessedPreprocess the line so other methods can easily read necessary information for creating vertex.- Specified by:
preprocessLinein 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.TextVertexReaderFromEachLineProcessedReads vertex id from the preprocessed line.- Specified by:
getIdin 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 MultipleLongWritable getValue(String[] tokens) throws IOException
Description copied from class:TextVertexInputFormat.TextVertexReaderFromEachLineProcessedReads vertex value from the preprocessed line.- Specified by:
getValuein 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,MultipleLongWritable>> getEdges(String[] tokens) throws IOException
Description copied from class:TextVertexInputFormat.TextVertexReaderFromEachLineProcessedReads edges from the preprocessed line.- Specified by:
getEdgesin classTextVertexInputFormat.TextVertexReaderFromEachLineProcessed<String[]>- Parameters:
tokens- the object obtained by preprocessing the line- Returns:
- the edges
- Throws:
IOException- exception that can be thrown while reading
-
-