Package org.apache.giraph.job

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


    // 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;
  }

  /**
   * Populate internal Hadoop Job (and Giraph IO Formats) with Hadoop-specific
   * configuration/setup metadata, propagating exceptions to calling code.
View Full Code Here


                    throw new IllegalArgumentException("The provided input path does not exist: " + inputPath);
                FileInputFormat.setInputPaths(job.getInternalJob(), inputPath);
                FileOutputFormat.setOutputPath(job.getInternalJob(), new Path(this.giraphConfiguration.get(Constants.GREMLIN_GIRAPH_OUTPUT_LOCATION) + "/" + Constants.SYSTEM_G));
                // job.getInternalJob().setJarByClass(GiraphGraphComputer.class);
                LOGGER.info(Constants.GIRAPH_GREMLIN_JOB_PREFIX + this.vertexProgram);
                if (!job.run(true)) {
                    throw new IllegalStateException("The Giraph-Gremlin job failed -- aborting all subsequent MapReduce jobs");
                }
                this.mapReduces.addAll(this.vertexProgram.getMapReducers());
                // calculate main vertex program memory if desired (costs one mapreduce job)
                if (this.giraphConfiguration.getBoolean(Constants.GREMLIN_GIRAPH_DERIVE_MEMORY, false)) {
View Full Code Here

    giraphConf.setWorkerConfiguration(workers, workers, 100.0f);
    initGiraphJob(job);

    logOptions(giraphConf);

    return job.run(isVerbose) ? 0 : -1;
  }

  /**
   * Create ImmutableClassesGiraphConfiguration from provided Configuration
   * which is going to copy all the values set to it to this original
View Full Code Here

    String name = HiveJythonUtils.writeJythonJobToConf(jythonJob, CONF,
       interpreter);

    GiraphJob job = new GiraphJob(CONF, name);
    return job.run(true) ? 0 : -1;
  }

  /**
   * Log options used
   */
 
View Full Code Here

    boolean isVerbose = false;
    if (BenchmarkOption.VERBOSE.optionTurnedOn(cmd)) {
      isVerbose = true;
    }
    if (job.run(isVerbose)) {
      return 0;
    } else {
      return -1;
    }
  }
View Full Code Here

    }
    if (cmd.hasOption('s')) {
      getConf().setInt(SUPERSTEP_COUNT,
          Integer.parseInt(cmd.getOptionValue('s')));
    }
    if (bspJob.run(verbose)) {
      return 0;
    } else {
      return -1;
    }
  }
View Full Code Here

        PseudoRandomInputFormatConstants.AGGREGATE_VERTICES, 101);
    job.getConfiguration().setLong(
        PseudoRandomInputFormatConstants.EDGES_PER_VERTEX, 2);
    job.getConfiguration().setInt(
        WeightedPageRankComputation.SUPERSTEP_COUNT, 2);
    assertTrue(job.run(true));

    Path outputPath2 = getTempPath(getCallingMethodName() + "2");
    conf = new GiraphConfiguration();
    conf.setComputationClass(WeightedPageRankComputation.class);
    conf.setVertexInputFormatClass(JsonBase64VertexInputFormat.class);
View Full Code Here

    job = prepareJob(getCallingMethodName(), conf, outputPath2);
    job.getConfiguration().setInt(
        WeightedPageRankComputation.SUPERSTEP_COUNT, 3);
    GiraphFileInputFormat.addVertexInputPath(
      job.getInternalJob().getConfiguration(), outputPath);
    assertTrue(job.run(true));

    Path outputPath3 = getTempPath(getCallingMethodName() + "3");
    conf = new GiraphConfiguration();
    conf.setComputationClass(WeightedPageRankComputation.class);
    conf.setVertexInputFormatClass(PseudoRandomVertexInputFormat.class);
View Full Code Here

    conf = job.getConfiguration();
    conf.setLong(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES, 101);
    conf.setLong(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX, 2);
    conf.setInt(
        WeightedPageRankComputation.SUPERSTEP_COUNT, 5);
    assertTrue(job.run(true));

    assertEquals(101, getNumResults(conf, outputPath));
    assertEquals(101, getNumResults(conf, outputPath2));
    assertEquals(101, getNumResults(conf, outputPath3));
  }
View Full Code Here

    conf = job.getConfiguration();
    conf.setWorkerConfiguration(5, 5, 100.0f);
    GiraphConstants.SPLIT_MASTER_WORKER.set(conf, true);

    try {
      job.run(true);
      fail();
    } catch (IllegalArgumentException e) {
    }

    GiraphConstants.SPLIT_MASTER_WORKER.set(conf, false);
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.