Class InternalHBaseVertexRunner


  • public class InternalHBaseVertexRunner
    extends Object
    A base class for running internal tests on a vertex

    Extending classes only have to invoke the run() method to test their vertex. All data is written to a local tmp directory that is removed afterwards. A local zookeeper instance is started in an extra thread and shutdown at the end.

    Heavily inspired from Apache Mahout's MahoutTestCase

    • Method Detail

      • run

        public static Iterable<String> run​(org.apache.giraph.conf.GiraphConfiguration conf)
                                    throws Exception
        Attempts to run the vertex internally in the current JVM, reading from and writing to a temporary folder on local disk. Will start its own zookeeper instance.
        Parameters:
        conf - GiraphClasses specifying which types to use
        Returns:
        linewise output data, or null if job fails
        Throws:
        Exception - if anything goes wrong
      • run

        public static Iterable<String> run​(org.apache.giraph.conf.GiraphConfiguration conf,
                                           String checkpointsDir,
                                           File tmpDir)
                                    throws Exception
        Attempts to run the vertex internally in the current JVM, reading from and writing to a temporary folder on local disk. Will start its own zookeeper instance.
        Parameters:
        conf - GiraphClasses specifying which types to use
        checkpointsDir - if set, will use this folder for storing checkpoints.
        tmpDir - file path for storing temporary files.
        Returns:
        linewise output data, or null if job fails
        Throws:
        Exception - if anything goes wrong