Class TextEdgeInputFormat.TextEdgeReaderFromEachLineProcessed<T>

  • Type Parameters:
    T - The resulting type of preprocessing.
    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:
    DatagenEdgeInputFormat.LiveJournalEdgeReader, LiveJournalEdgeInputFormat.LiveJournalEdgeReader, P2PEdgeInputFormat.P2PEdgeReader
    Enclosing class:
    TextEdgeInputFormat<I extends org.apache.hadoop.io.WritableComparable,​E extends org.apache.hadoop.io.Writable>

    protected abstract class TextEdgeInputFormat.TextEdgeReaderFromEachLineProcessed<T>
    extends TextEdgeInputFormat.TextEdgeReader
    Abstract class to be implemented by the user to read an edge from each text line after preprocessing it.
    • Constructor Detail

      • TextEdgeReaderFromEachLineProcessed

        protected TextEdgeReaderFromEachLineProcessed()
    • Method Detail

      • getCurrentEdge

        public final org.apache.giraph.edge.Edge<I,​E> getCurrentEdge()
                                                                    throws IOException,
                                                                           InterruptedException
        Specified by:
        getCurrentEdge in class org.apache.giraph.io.EdgeReader<I extends org.apache.hadoop.io.WritableComparable,​E extends org.apache.hadoop.io.Writable>
        Throws:
        IOException
        InterruptedException
      • preprocessLine

        protected abstract T preprocessLine​(org.apache.hadoop.io.Text line)
                                     throws IOException
        Preprocess the line so other methods can easily read necessary information for creating edge
        Parameters:
        line - the current line to be read
        Returns:
        the preprocessed object
        Throws:
        IOException - exception that can be thrown while reading
      • getTargetVertexId

        protected abstract I getTargetVertexId​(T line)
                                        throws IOException
        Reads target vertex id from the preprocessed line.
        Parameters:
        line - the object obtained by preprocessing the line
        Returns:
        the target vertex id
        Throws:
        IOException - exception that can be thrown while reading
      • getSourceVertexId

        protected abstract I getSourceVertexId​(T line)
                                        throws IOException
        Reads source vertex id from the preprocessed line.
        Parameters:
        line - the object obtained by preprocessing the line
        Returns:
        the source vertex id
        Throws:
        IOException - exception that can be thrown while reading
      • getValue

        protected abstract E getValue​(T line)
                               throws IOException
        Reads edge value from the preprocessed line.
        Parameters:
        line - the object obtained by preprocessing the line
        Returns:
        the edge value
        Throws:
        IOException - exception that can be thrown while reading