Package org.apache.giraph.io.formats
Class TextVertexOutputFormat.TextVertexWriter
- java.lang.Object
-
- org.apache.giraph.conf.DefaultImmutableClassesGiraphConfigurable<I,V,E>
-
- org.apache.giraph.io.VertexWriter<I,V,E>
-
- org.apache.giraph.io.formats.TextVertexOutputFormat.TextVertexWriter
-
- All Implemented Interfaces:
org.apache.giraph.conf.GiraphConfigurationSettable<I,V,E>,org.apache.giraph.conf.ImmutableClassesGiraphConfigurable<I,V,E>,org.apache.giraph.io.SimpleVertexWriter<I,V,E>
- Direct Known Subclasses:
PageRank.SimplePageRankVertexOutputFormat.SimplePageRankVertexWriter,SSSP.SimpleSuperstepVertexOutputFormat.SimpleSuperstepVertexWriter,TextVertexOutputFormat.TextVertexWriterToEachLine
- Enclosing class:
- TextVertexOutputFormat<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
protected abstract class TextVertexOutputFormat.TextVertexWriter extends org.apache.giraph.io.VertexWriter<I,V,E>Abstract class to be implemented by the user based on their specific vertex output. Easiest to ignore the key value separator and only use key instead.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTextVertexWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(org.apache.hadoop.mapreduce.TaskAttemptContext context)protected org.apache.hadoop.mapreduce.RecordWriter<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>createLineRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context)Create the line record writer.org.apache.hadoop.mapreduce.TaskAttemptContextgetContext()Get the context.org.apache.hadoop.mapreduce.RecordWriter<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>getRecordWriter()Get the line record writer.voidinitialize(org.apache.hadoop.mapreduce.TaskAttemptContext context)-
Methods inherited from class org.apache.giraph.conf.DefaultImmutableClassesGiraphConfigurable
getConf, setConf
-
-
-
-
Method Detail
-
initialize
public void initialize(org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException, InterruptedException- Specified by:
initializein classorg.apache.giraph.io.VertexWriter<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>- Throws:
IOExceptionInterruptedException
-
createLineRecordWriter
protected org.apache.hadoop.mapreduce.RecordWriter<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text> createLineRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException, InterruptedExceptionCreate the line record writer. Override this to use a different underlying record writer (useful for testing).- Parameters:
context- the context passed to initialize- Returns:
- the record writer to be used
- Throws:
IOException- exception that can be thrown during creationInterruptedException- exception that can be thrown during creation
-
close
public void close(org.apache.hadoop.mapreduce.TaskAttemptContext context) throws InterruptedException, IOException- Specified by:
closein classorg.apache.giraph.io.VertexWriter<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>- Throws:
InterruptedExceptionIOException
-
getRecordWriter
public org.apache.hadoop.mapreduce.RecordWriter<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text> getRecordWriter()
Get the line record writer.- Returns:
- Record writer to be used for writing.
-
getContext
public org.apache.hadoop.mapreduce.TaskAttemptContext getContext()
Get the context.- Returns:
- Context passed to initialize.
-
-