Examples of GiraphTypes


Examples of org.apache.giraph.conf.GiraphTypes

   * @param jythonJob the job info
   * @param interpreter PythonInterpreter to use
   */
  private static void initGraphTypes(Configuration conf,
      JythonJob jythonJob, PythonInterpreter interpreter) {
    GiraphTypes types = new GiraphTypes();
    types.setVertexIdClass(initValueType(conf, GraphType.VERTEX_ID,
        jythonJob.getVertex_id().getType(), new JythonVertexIdFactory(),
        interpreter));
    types.setVertexValueClass(initValueType(conf, GraphType.VERTEX_VALUE,
        jythonJob.getVertex_value().getType(), new JythonVertexValueFactory(),
        interpreter));
    types.setEdgeValueClass(initValueType(conf, GraphType.EDGE_VALUE,
        jythonJob.getEdge_value().getType(), new JythonEdgeValueFactory(),
        interpreter));
    types.setIncomingMessageValueClass(
        initValueType(conf, GraphType.INCOMING_MESSAGE_VALUE,
            jythonJob.getIncoming_message_value().getType(),
            new JythonIncomingMessageValueFactory(), interpreter));
    types.setOutgoingMessageValueClass(
        initValueType(conf, GraphType.OUTGOING_MESSAGE_VALUE,
            jythonJob.getOutgoing_message_value().getType(),
            new JythonOutgoingMessageValueFactory(), interpreter));
    types.writeTo(conf);
  }
View Full Code Here

Examples of org.apache.giraph.conf.GiraphTypes

  @Override
  protected void prepareConfiguration(GiraphConfiguration conf,
      CommandLine cmd) {
    if (BenchmarkOption.JYTHON.optionTurnedOn(cmd)) {
      GiraphTypes types = new GiraphTypes();
      types.inferFrom(PageRankComputation.class);

      String script;
      DeployType deployType;
      if (BenchmarkOption.SCRIPT_PATH.optionTurnedOn(cmd)) {
        deployType = DeployType.DISTRIBUTED_CACHE;
        String path = BenchmarkOption.SCRIPT_PATH.getOptionValue(cmd);
        Path hadoopPath = new Path(path);
        Path remotePath = DistributedCacheUtils.copyAndAdd(hadoopPath, conf);
        script = remotePath.toString();
      } else {
        deployType = DeployType.RESOURCE;
        script = ReflectionUtils.getPackagePath(this) + "/page-rank.py";
      }
      ScriptLoader.setScriptsToLoad(conf, script, deployType, Language.JYTHON);
      types.writeIfUnset(conf);
      JythonUtils.init(conf, "PageRank");
    } else {
      conf.setComputationClass(PageRankComputation.class);
    }
    conf.setOutEdgesClass(IntNullArrayEdges.class);
View Full Code Here

Examples of org.apache.giraph.conf.GiraphTypes

        "2 4",
        "4 1"
    };

    GiraphConfiguration conf = new GiraphConfiguration();
    GiraphTypes types = new GiraphTypes(IntWritable.class, IntWritable.class,
        NullWritable.class, NullWritable.class, NullWritable.class);
    types.writeIfUnset(conf);
    ScriptLoader.setScriptsToLoad(conf,
        "org/apache/giraph/jython/count-edges.py",
        DeployType.RESOURCE, Language.JYTHON);
    JythonUtils.init(conf, "CountEdges");
    conf.setOutEdgesClass(ByteArrayEdges.class);
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.