Package org.apache.giraph.graph

Examples of org.apache.giraph.graph.GiraphJob.run()


        GiraphJob job = new GiraphJob(getCallingMethodName());
        setupConfiguration(job);
        job.setVertexClass(SimpleCombinerVertex.class);
        job.setVertexInputFormatClass(SimpleSuperstepVertexInputFormat.class);
        job.setVertexCombinerClass(SimpleSumCombiner.class);
        assertTrue(job.run(true));
    }

    /**
     * Run a sample BSP job locally and test PageRank.
     *
 
View Full Code Here


        setupConfiguration(job);
        job.setVertexClass(SimplePageRankVertex.class);
        job.setWorkerContextClass(
          SimplePageRankVertex.SimplePageRankVertexWorkerContext.class);
        job.setVertexInputFormatClass(SimplePageRankVertexInputFormat.class);
        assertTrue(job.run(true));
        if (getJobTracker() == null) {
            double maxPageRank =
              SimplePageRankVertex.SimplePageRankVertexWorkerContext.finalMax;
            double minPageRank =
              SimplePageRankVertex.SimplePageRankVertexWorkerContext.finalMin;
View Full Code Here

        job.setVertexOutputFormatClass(
            SimpleShortestPathsVertexOutputFormat.class);
        job.getConfiguration().setLong(SimpleShortestPathsVertex.SOURCE_ID, 0);
        Path outputPath = new Path("/tmp/" + getCallingMethodName());
        removeAndSetOutput(job, outputPath);
        assertTrue(job.run(true));

        job = new GiraphJob(getCallingMethodName());
        setupConfiguration(job);
        job.setVertexClass(SimpleShortestPathsVertex.class);
        job.setVertexInputFormatClass(SimplePageRankVertexInputFormat.class);
View Full Code Here

        job.setVertexOutputFormatClass(
            SimpleShortestPathsVertexOutputFormat.class);
        job.getConfiguration().setLong(SimpleShortestPathsVertex.SOURCE_ID, 0);
        Path outputPath2 = new Path("/tmp/" + getCallingMethodName() + "2");
        removeAndSetOutput(job, outputPath2);
        assertTrue(job.run(true));
        if (getJobTracker() == null) {
            FileStatus fileStatus = getSinglePartFileStatus(job, outputPath);
            FileStatus fileStatus2 = getSinglePartFileStatus(job, outputPath2);
            assertTrue(fileStatus.getLen() == fileStatus2.getLen());
        }
View Full Code Here

            SimplePageRankVertex.SimplePageRankVertexWorkerContext.class);
        job.setVertexInputFormatClass(SimplePageRankVertexInputFormat.class);
        job.setAggregatorWriterClass(SimpleAggregatorWriter.class);
        Path outputPath = new Path("/tmp/" + getCallingMethodName());
        removeAndSetOutput(job, outputPath);
        assertTrue(job.run(true));
        if (getJobTracker() == null) {
            double maxPageRank =
                SimplePageRankVertex.SimplePageRankVertexWorkerContext.finalMax;
            double minPageRank =
                SimplePageRankVertex.SimplePageRankVertexWorkerContext.finalMin;
View Full Code Here

        }
        if (cmd.hasOption('f')) {
            job.getConfiguration().setInt(GiraphJob.MSG_NUM_FLUSH_THREADS,
                Integer.parseInt(cmd.getOptionValue('f')));
        }
        if (job.run(isVerbose) == true) {
            return 0;
        } else {
            return -1;
        }
    }
View Full Code Here

        job.setVertexOutputFormatClass(SimpleSuperstepVertexOutputFormat.class);
        job.setWorkerContextClass(
            SimpleCheckpointVertex.SimpleCheckpointVertexWorkerContext.class);
        Path outputPath = new Path("/tmp/" + getCallingMethodName());
        removeAndSetOutput(job, outputPath);
        assertTrue(job.run(true));
    }
}
View Full Code Here

        job.setVertexClass(SimpleCheckpointVertex.class);
        job.setVertexInputFormatClass(SimpleSuperstepVertexInputFormat.class);
        job.setVertexOutputFormatClass(SimpleSuperstepVertexOutputFormat.class);
        Path outputPath = new Path("/tmp/" + getCallingMethodName());
        removeAndSetOutput(job, outputPath);
        assertFalse(job.run(false));
    }
}
View Full Code Here

            SimpleCheckpointVertex.SimpleCheckpointVertexWorkerContext.class);
        job.setVertexInputFormatClass(SimpleSuperstepVertexInputFormat.class);
        job.setVertexOutputFormatClass(SimpleSuperstepVertexOutputFormat.class);
        Path outputPath = new Path("/tmp/" + getCallingMethodName());
        removeAndSetOutput(job, outputPath);
        assertTrue(job.run(true));
        long fileLen = 0;
        long idSum = 0;
        if (getJobTracker() == null) {
            FileStatus fileStatus = getSinglePartFileStatus(job, outputPath);
            fileLen = fileStatus.getLen();
View Full Code Here

            SimpleSuperstepVertexInputFormat.class);
        restartedJob.setVertexOutputFormatClass(
            SimpleSuperstepVertexOutputFormat.class);
        outputPath = new Path("/tmp/" + getCallingMethodName() + "Restarted");
        removeAndSetOutput(restartedJob, outputPath);
        assertTrue(restartedJob.run(true));
        if (getJobTracker() == null) {
            FileStatus fileStatus = getSinglePartFileStatus(job, outputPath);
            fileLen = fileStatus.getLen();
            assertTrue(fileStatus.getLen() == fileLen);
            long idSumRestarted =
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.