Package org.apache.giraph.graph

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


                        throw new RuntimeException(e);
                    }
                }
            });
            try {
                job.run(true);
            } finally {
                executorService.shutdown();
                zookeeper.end();
            }
View Full Code Here


        job.getConfiguration().set(
            PartitionBalancer.PARTITION_BALANCE_ALGORITHM,
            PartitionBalancer.VERTICES_BALANCE_ALGORITHM);
        Path outputPath = new Path("/tmp/testVertexBalancer");
        removeAndSetOutput(job, outputPath);
        assertTrue(job.run(true));
        FileSystem hdfs = FileSystem.get(job.getConfiguration());
        if (getJobTracker() != null) {
            FileStatus [] fileStatusArr = hdfs.listStatus(outputPath);
            int totalLen = 0;
            for (FileStatus fileStatus : fileStatusArr) {
View Full Code Here

            SimpleCheckpointVertex.SimpleCheckpointVertexWorkerContext.class);
        job.setVertexInputFormatClass(SimpleSuperstepVertexInputFormat.class);
        job.setVertexOutputFormatClass(SimpleSuperstepVertexOutputFormat.class);
        outputPath = new Path("/tmp/testHashPartitioner");
        removeAndSetOutput(job, outputPath);
        assertTrue(job.run(true));
        if (getJobTracker() != null) {
            FileStatus [] fileStatusArr = hdfs.listStatus(outputPath);
            int totalLen = 0;
            for (FileStatus fileStatus : fileStatusArr) {
                if (fileStatus.getPath().toString().contains("/part-m-")) {
View Full Code Here

        job.setVertexOutputFormatClass(SimpleSuperstepVertexOutputFormat.class);
        job.setGraphPartitionerFactoryClass(
            SuperstepHashPartitionerFactory.class);
        outputPath = new Path("/tmp/testSuperstepHashPartitioner");
        removeAndSetOutput(job, outputPath);
        assertTrue(job.run(true));
        if (getJobTracker() != null) {
            FileStatus [] fileStatusArr = hdfs.listStatus(outputPath);
            int totalLen = 0;
            for (FileStatus fileStatus : fileStatusArr) {
                if (fileStatus.getPath().toString().contains("/part-m-")) {
View Full Code Here

        job.setVertexOutputFormatClass(SimpleSuperstepVertexOutputFormat.class);
        job.setGraphPartitionerFactoryClass(
            HashRangePartitionerFactory.class);
        outputPath = new Path("/tmp/testHashRangePartitioner");
        removeAndSetOutput(job, outputPath);
        assertTrue(job.run(true));
        if (getJobTracker() != null) {
            FileStatus [] fileStatusArr = hdfs.listStatus(outputPath);
            int totalLen = 0;
            for (FileStatus fileStatus : fileStatusArr) {
                if (fileStatus.getPath().toString().contains("/part-m-")) {
View Full Code Here

        job.getConfiguration().setBoolean(
            GeneratedVertexReader.REVERSE_ID_ORDER,
            true);
        outputPath = new Path("/tmp/testReverseIdSuperstepHashPartitioner");
        removeAndSetOutput(job, outputPath);
        assertTrue(job.run(true));
        if (getJobTracker() != null) {
            FileStatus [] fileStatusArr = hdfs.listStatus(outputPath);
            int totalLen = 0;
            for (FileStatus fileStatus : fileStatusArr) {
                if (fileStatus.getPath().toString().contains("/part-m-")) {
View Full Code Here

        Configuration conf = job.getConfiguration();
        conf.set(SimpleVertexWithWorkerContext.OUTPUTDIR, args[0]);
        job.setWorkerConfiguration(Integer.parseInt(args[1]),
                                   Integer.parseInt(args[1]),
                                   100.0f);
        if (job.run(true) == true) {
            return 0;
        } else {
            return -1;
        }
    }
View Full Code Here

        job.getConfiguration().setLong(
            PseudoRandomVertexInputFormat.EDGES_PER_VERTEX, 2);
        job.getConfiguration().setInt(PageRankBenchmark.SUPERSTEP_COUNT, 2);
        Path outputPath = new Path("/tmp/" + getCallingMethodName());
        removeAndSetOutput(job, outputPath);
        assertTrue(job.run(true));

        job = new GiraphJob(getCallingMethodName());
        setupConfiguration(job);
        job.setVertexClass(PageRankBenchmark.PageRankEdgeListVertex.class);
        job.setVertexInputFormatClass(JsonBase64VertexInputFormat.class);
View Full Code Here

        job.setVertexOutputFormatClass(JsonBase64VertexOutputFormat.class);
        job.getConfiguration().setInt(PageRankBenchmark.SUPERSTEP_COUNT, 3);
        FileInputFormat.setInputPaths(job, outputPath);
        Path outputPath2 = new Path("/tmp/" + getCallingMethodName() + "2");
        removeAndSetOutput(job, outputPath2);
        assertTrue(job.run(true));

        FileStatus twoJobsFile = null;
        if (getJobTracker() == null) {
            twoJobsFile = getSinglePartFileStatus(job, outputPath);
        }
View Full Code Here

        job.getConfiguration().setLong(
            PseudoRandomVertexInputFormat.EDGES_PER_VERTEX, 2);
        job.getConfiguration().setInt(PageRankBenchmark.SUPERSTEP_COUNT, 5);
        Path outputPath3 = new Path("/tmp/" + getCallingMethodName() + "3");
        removeAndSetOutput(job, outputPath3);
        assertTrue(job.run(true));

        if (getJobTracker() == null) {
            FileStatus oneJobFile = getSinglePartFileStatus(job, outputPath3);
            assertTrue(twoJobsFile.getLen() == oneJobFile.getLen());
        }
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.