Class TextEdgeInputFormat.TextEdgeReader

  • All Implemented Interfaces:
    org.apache.giraph.aggregators.AggregatorUsage, org.apache.giraph.conf.GiraphConfigurationSettable<I,​org.apache.hadoop.io.Writable,​E>, org.apache.giraph.conf.ImmutableClassesGiraphConfigurable<I,​org.apache.hadoop.io.Writable,​E>, org.apache.giraph.worker.WorkerAggregatorUsage, org.apache.giraph.worker.WorkerBroadcastUsage, org.apache.giraph.worker.WorkerGlobalCommUsage, org.apache.giraph.worker.WorkerReduceUsage
    Direct Known Subclasses:
    TextEdgeInputFormat.TextEdgeReaderFromEachLine, TextEdgeInputFormat.TextEdgeReaderFromEachLineProcessed
    Enclosing class:
    TextEdgeInputFormat<I extends org.apache.hadoop.io.WritableComparable,​E extends org.apache.hadoop.io.Writable>

    protected abstract class TextEdgeInputFormat.TextEdgeReader
    extends org.apache.giraph.io.EdgeReader<I,​E>
    EdgeReader for TextEdgeInputFormat.
    • Constructor Detail

      • TextEdgeReader

        protected TextEdgeReader()
    • Method Detail

      • initialize

        public void initialize​(org.apache.hadoop.mapreduce.InputSplit inputSplit,
                               org.apache.hadoop.mapreduce.TaskAttemptContext context)
                        throws IOException,
                               InterruptedException
        Specified by:
        initialize in class org.apache.giraph.io.EdgeReader<I extends org.apache.hadoop.io.WritableComparable,​E extends org.apache.hadoop.io.Writable>
        Throws:
        IOException
        InterruptedException
      • createLineRecordReader

        protected org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,​org.apache.hadoop.io.Text> createLineRecordReader​(org.apache.hadoop.mapreduce.InputSplit inputSplit,
                                                                                                                                                     org.apache.hadoop.mapreduce.TaskAttemptContext context)
                                                                                                                                              throws IOException,
                                                                                                                                                     InterruptedException
        Create the line record reader. Override this to use a different underlying record reader (useful for testing).
        Parameters:
        inputSplit - the split to read
        context - the context passed to initialize
        Returns:
        the record reader to be used
        Throws:
        IOException - exception that can be thrown during creation
        InterruptedException - exception that can be thrown during creation
      • close

        public void close()
                   throws IOException
        Specified by:
        close in class org.apache.giraph.io.EdgeReader<I extends org.apache.hadoop.io.WritableComparable,​E extends org.apache.hadoop.io.Writable>
        Throws:
        IOException
      • getRecordReader

        protected org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,​org.apache.hadoop.io.Text> getRecordReader()
        Get the line record reader.
        Returns:
        Record reader to be used for reading.
      • getContext

        protected org.apache.hadoop.mapreduce.TaskAttemptContext getContext()
        Get the context.
        Returns:
        Context passed to initialize.