org.apache.giraph.examples
Class GeneratedVertexReader<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>

java.lang.Object
  extended by org.apache.giraph.conf.DefaultImmutableClassesGiraphConfigurable<I,V,E>
      extended by org.apache.giraph.io.VertexReader<I,V,E>
          extended by org.apache.giraph.examples.GeneratedVertexReader<I,V,E>
Type Parameters:
I - Vertex index value
V - Vertex value
E - Edge value
All Implemented Interfaces:
ImmutableClassesGiraphConfigurable<I,V,E>
Direct Known Subclasses:
SimplePageRankComputation.SimplePageRankVertexReader, SimpleSuperstepComputation.SimpleSuperstepVertexReader

public abstract class GeneratedVertexReader<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
extends VertexReader<I,V,E>

Used by GeneratedVertexInputFormat to read some generated data


Field Summary
static boolean DEAFULT_REVERSE_ID_ORDER
          Default ordering is not reversed
static long DEFAULT_READER_VERTICES
          Default vertices produced by this reader
protected  BspInputSplit inputSplit
          The input split from initialize().
static String READER_VERTICES
          Vertices produced by this reader
protected  long recordsRead
          Records read so far
static String REVERSE_ID_ORDER
          Reverse the order of the vertices?
protected  boolean reverseIdOrder
          Reverse the id order?
protected  long totalRecords
          Total records to read (on this split alone)
 
Constructor Summary
GeneratedVertexReader()
          Default constructor for reflection.
 
Method Summary
 void close()
          Close this VertexReader to future operations.
 float getProgress()
          How much of the input has the VertexReader consumed i.e.
 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.
 
Methods inherited from class org.apache.giraph.io.VertexReader
getCurrentVertex, nextVertex
 
Methods inherited from class org.apache.giraph.conf.DefaultImmutableClassesGiraphConfigurable
getConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READER_VERTICES

public static final String READER_VERTICES
Vertices produced by this reader

See Also:
Constant Field Values

DEFAULT_READER_VERTICES

public static final long DEFAULT_READER_VERTICES
Default vertices produced by this reader

See Also:
Constant Field Values

REVERSE_ID_ORDER

public static final String REVERSE_ID_ORDER
Reverse the order of the vertices?

See Also:
Constant Field Values

DEAFULT_REVERSE_ID_ORDER

public static final boolean DEAFULT_REVERSE_ID_ORDER
Default ordering is not reversed

See Also:
Constant Field Values

recordsRead

protected long recordsRead
Records read so far


totalRecords

protected long totalRecords
Total records to read (on this split alone)


inputSplit

protected BspInputSplit inputSplit
The input split from initialize().


reverseIdOrder

protected boolean reverseIdOrder
Reverse the id order?

Constructor Detail

GeneratedVertexReader

public GeneratedVertexReader()
Default constructor for reflection.

Method Detail

initialize

public final void initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit,
                             org.apache.hadoop.mapreduce.TaskAttemptContext context)
                      throws IOException
Description copied from class: VertexReader
Use the input split and context to setup reading the vertices. Guaranteed to be called prior to any other function.

Specified by:
initialize in class VertexReader<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
Parameters:
inputSplit - Input split to be used for reading vertices.
context - Context from the task.
Throws:
IOException

close

public void close()
           throws IOException
Description copied from class: VertexReader
Close this VertexReader to future operations.

Specified by:
close in class VertexReader<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
Throws:
IOException

getProgress

public final float getProgress()
                        throws IOException
Description copied from class: VertexReader
How much of the input has the VertexReader consumed i.e. has been processed by?

Specified by:
getProgress in class VertexReader<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
Returns:
Progress from 0.0 to 1.0.
Throws:
IOException


Copyright © 2011-2013 The Apache Software Foundation. All Rights Reserved.