protected abstract class AdjacencyListTextVertexInputFormat.AdjacencyListTextVertexReader extends TextVertexInputFormat.TextVertexReaderFromEachLineProcessed<String[]>
AdjacencyListTextVertexInputFormat
.Constructor and Description |
---|
AdjacencyListTextVertexReader()
Constructor without line sanitizer.
|
AdjacencyListTextVertexReader(AdjacencyListTextVertexInputFormat.LineSanitizer sanitizer)
Constructor with line sanitizer.
|
Modifier and Type | Method and Description |
---|---|
abstract Edge<I,E> |
decodeEdge(String id,
String value)
Decode an edge from the line into an instance of a correctly typed Edge
|
abstract I |
decodeId(String s)
Decode the id for this line into an instance of its correct type.
|
abstract V |
decodeValue(String s)
Decode the value for this line into an instance of its correct type.
|
protected Iterable<Edge<I,E>> |
getEdges(String[] values)
Reads edges from the preprocessed line.
|
protected I |
getId(String[] values)
Reads vertex id from the preprocessed line.
|
protected V |
getValue(String[] values)
Reads vertex value from the preprocessed line.
|
void |
initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit,
org.apache.hadoop.mapreduce.TaskAttemptContext context)
Use the input split and context to setup reading the vertices.
|
protected String[] |
preprocessLine(org.apache.hadoop.io.Text line)
Preprocess the line so other methods can easily read necessary
information for creating vertex.
|
getCurrentVertex, nextVertex
close, createLineRecordReader, getContext, getProgress, getRecordReader
aggregate, getAggregatedValue, getBroadcast, reduce, reduceMerge, setWorkerGlobalCommUsage
getConf, setConf
public AdjacencyListTextVertexReader()
public AdjacencyListTextVertexReader(AdjacencyListTextVertexInputFormat.LineSanitizer sanitizer)
sanitizer
- Sanitizer to be used.public void initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException, InterruptedException
VertexReader
initialize
in class TextVertexInputFormat.TextVertexReader
inputSplit
- Input split to be used for reading vertices.context
- Context from the task.IOException
InterruptedException
protected String[] preprocessLine(org.apache.hadoop.io.Text line) throws IOException
TextVertexInputFormat.TextVertexReaderFromEachLineProcessed
preprocessLine
in class TextVertexInputFormat.TextVertexReaderFromEachLineProcessed<String[]>
line
- the current line to be readIOException
- exception that can be thrown while readingprotected I getId(String[] values) throws IOException
TextVertexInputFormat.TextVertexReaderFromEachLineProcessed
getId
in class TextVertexInputFormat.TextVertexReaderFromEachLineProcessed<String[]>
values
- the object obtained by preprocessing the lineIOException
- exception that can be thrown while readingpublic abstract I decodeId(String s)
s
- Id of vertex from lineprotected V getValue(String[] values) throws IOException
TextVertexInputFormat.TextVertexReaderFromEachLineProcessed
getValue
in class TextVertexInputFormat.TextVertexReaderFromEachLineProcessed<String[]>
values
- the object obtained by preprocessing the lineIOException
- exception that can be thrown while readingpublic abstract V decodeValue(String s)
s
- Value from lineprotected Iterable<Edge<I,E>> getEdges(String[] values) throws IOException
TextVertexInputFormat.TextVertexReaderFromEachLineProcessed
getEdges
in class TextVertexInputFormat.TextVertexReaderFromEachLineProcessed<String[]>
values
- the object obtained by preprocessing the lineIOException
- exception that can be thrown while readingCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.