protected GiraphJob getJob(GiraphConfiguration conf, String jobName) throws IOException { return new GiraphJob(conf, jobName); }
@Override /** * Drives a job run configured for "Giraph on Hadoop MR cluster" * @param args the command line arguments * @return job run exit code */ public int run(String[] args) throws Exception { if (null == getConf()) { // for YARN profile conf = new Configuration(); } GiraphConfiguration giraphConf = new GiraphConfiguration(getConf()); CommandLine cmd = ConfigurationUtils.parseArgs(giraphConf, args); if (null == cmd) { return 0; // user requested help/info printout, don't run a job. } // set up job for various platforms final String vertexClassName = args[0]; final String jobName = "Giraph: " + vertexClassName; GiraphJob job = new GiraphJob(giraphConf, jobName); prepareHadoopMRJob(job, cmd); // run the job, collect results if (LOG.isDebugEnabled()) { LOG.debug("Attempting to run Vertex: " + vertexClassName); } boolean verbose = !cmd.hasOption('q'); return job.run(verbose) ? 0 : -1; }
GiraphJob bspJob = new GiraphJob(getConf(), getClass().getName()); bspJob.getConfiguration().setComputationClass( SimpleCheckpointComputation.class);
GiraphJob job = new GiraphJob(getConf(), getClass().getName()); int workers = Integer.parseInt(BenchmarkOption.WORKERS.getOptionValue(cmd));
@Override public int run(String[] args) throws Exception { if (args.length != 2) { throw new IllegalArgumentException( "run: Must have 2 arguments <output path> <# of workers>"); } GiraphJob job = new GiraphJob(getConf(), getClass().getName()); job.getConfiguration().setComputationClass(SimpleComputation.class); job.getConfiguration().setVertexInputFormatClass( SimpleSuperstepVertexInputFormat.class); job.getConfiguration().setWorkerContextClass(EmitterWorkerContext.class); job.getConfiguration().set( SimpleVertexWithWorkerContext.OUTPUTDIR, args[0]); job.getConfiguration().setWorkerConfiguration(Integer.parseInt(args[1]), Integer.parseInt(args[1]), 100.0f); if (job.run(true)) { return 0; } else { return -1; } }
GiraphJob job = new GiraphJob(conf, conf.getComputationName());
GiraphJob job = new GiraphJob(conf, conf.getComputationName());
GiraphJob job = new GiraphJob(conf, conf.getComputationName());