/** * Constructor. * * @param configuration User-defined configuration * @param jobName User-defined job name * @throws IOException */ public GiraphJob(Configuration configuration, String jobName) throws IOException { this(new GiraphConfiguration(configuration), jobName); }
/** * Constructor that will instantiate the configuration * * @param jobName User-defined job name * @throws IOException */ public GiraphJob(String jobName) throws IOException { this(new GiraphConfiguration(), jobName); }
@Override public void test() throws Exception { GiraphConfiguration conf = new GiraphConfiguration(); configurator.configure(conf); BlockUtils.initAndCheckConfig(conf); runTest(graphInitializer, graphChecker, conf); } });
@Test public void testNumberOfVertices() throws Exception { GiraphConfiguration conf = new GiraphConfiguration(); conf.setComputationClass(GiraphHelloWorld.class); conf.setVertexInputFormatClass(IntIntNullTextInputFormat.class); conf.setVertexOutputFormatClass(AdjacencyListTextVertexOutputFormat.class); Iterable<String> results = InternalVertexRunner.run(conf, graphSeed); } }
@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; }
final GiraphConfiguration giraphConf = new GiraphConfiguration(getConf()); final int zkPort = ZOOKEEPER_SERVER_PORT.get(giraphConf); final String zkBasePath = giraphConf.get(
@Override public int run(String[] args) throws Exception { if (null == getConf()) { conf = new Configuration(); } GiraphConfiguration giraphConf = new GiraphConfiguration(getConf()); YamlConfiguration yamlConfig = new YamlConfiguration(args); yamlConfig.load(); yamlConfig.populateGiraphConfiguration(giraphConf); // set up job for various platforms final String arabesqueComputationName = giraphConf.get(io.arabesque.conf.Configuration.CONF_COMPUTATION_CLASS); final String jobName = "Arabesque: " + arabesqueComputationName; // run the job, collect results if (LOG.isDebugEnabled()) { LOG.debug("Attempting to run computation: " + arabesqueComputationName); } GiraphJob job = getJob(giraphConf, jobName); boolean verbose = yamlConfig.getBoolean("verbose"); return job.run(verbose) ? 0 : -1; }
@Test public void testWorkerMessages() throws Exception { GiraphConfiguration conf = new GiraphConfiguration(); BlockUtils.setAndInitBlockFactoryClass(conf, TestWorkerMessagesBlockFactory.class); TestGraph testGraph = new TestGraph(conf); testGraph.addEdge(new LongWritable(1), new LongWritable(2), NullWritable.get()); LocalBlockRunner.runApp(testGraph); }
private static GiraphConfiguration createConf() { GiraphConfiguration conf = new GiraphConfiguration(); GiraphConstants.VERTEX_ID_CLASS.set(conf, LongWritable.class); GiraphConstants.VERTEX_VALUE_CLASS.set(conf, LongWritable.class); GiraphConstants.EDGE_VALUE_CLASS.set(conf, NullWritable.class); return conf; }
private static GiraphConfiguration createConf() { GiraphConfiguration conf = new GiraphConfiguration(); GiraphConstants.VERTEX_ID_CLASS.set(conf, LongWritable.class); GiraphConstants.VERTEX_VALUE_CLASS.set(conf, LongWritable.class); GiraphConstants.EDGE_VALUE_CLASS.set(conf, NullWritable.class); return conf; }