Package org.apache.giraph.conf

Examples of org.apache.giraph.conf.GiraphConfiguration


    PythonInterpreter interpreter = new PythonInterpreter();

    JythonJob jythonJob =
        HiveJythonUtils.parseJythonStreams(interpreter, launcher, worker);

    GiraphConfiguration conf = new GiraphConfiguration();

    ScriptLoader.setScriptsToLoad(conf, workerJythonPath, DeployType.RESOURCE,
        Language.JYTHON);

    HiveJythonUtils.writeJythonJobToConf(jythonJob, conf, interpreter);
View Full Code Here


  /**
   * @param conf configuration parameters
   */
  public void checkInputSpecs(Configuration conf) {
    GiraphConfiguration gconf = new GiraphConfiguration(conf);

    if (!gconf.hasEdgeInputFormat()) {
      String err = "Rexster Input I/O requires " +
                   "both Vertex- and EdgeInputFormat.";
      LOG.error(err);
      throw new RuntimeException(err);
    }
View Full Code Here

  }

  @Override
  public void checkOutputSpecs(JobContext context)
    throws IOException, InterruptedException {
    GiraphConfiguration gconf =
      new GiraphConfiguration(context.getConfiguration());
    String msg = "Rexster OutputFormat usage requires both Edge and Vertex " +
                 "OutputFormat's.";

    if (!gconf.hasEdgeOutputFormat()) {
      LOG.error(msg);
      throw new InterruptedException(msg);
    }

    String endpoint = GIRAPH_REXSTER_HOSTNAME.get(gconf);
View Full Code Here

        "2\t3,4",
        "4\t1",
    };
    hiveServer.loadData(tableName, rows);

    GiraphConfiguration conf = new GiraphConfiguration();
    HIVE_VERTEX_INPUT.setTable(conf, tableName);
    HIVE_VERTEX_INPUT.setClass(conf, HiveIntIntNullVertex.class);
    conf.setComputationClass(ComputationCountEdges.class);
    conf.setVertexInputFormatClass(HiveVertexInputFormat.class);
    conf.setVertexOutputFormatClass(IdWithValueTextOutputFormat.class);
    Iterable<String> output = InternalVertexRunner.run(conf, new String[0], new String[0]);

    Map<Integer, Integer> data = Helpers.parseIntIntResults(output);
    assertEquals(3, data.size());
    assertEquals(1, (int) data.get(1));
View Full Code Here

        "2\t3,4",
        "4\t1",
    };
    hiveServer.loadData(tableName, partition, rows);

    GiraphConfiguration conf = new GiraphConfiguration();
    HIVE_VERTEX_INPUT.setTable(conf, tableName);
    HIVE_VERTEX_INPUT.setPartition(conf, partition);
    HIVE_VERTEX_INPUT.setClass(conf, HiveIntIntNullVertex.class);
    conf.setComputationClass(ComputationCountEdges.class);
    conf.setVertexInputFormatClass(HiveVertexInputFormat.class);
    conf.setVertexOutputFormatClass(IdWithValueTextOutputFormat.class);
    Iterable<String> output = InternalVertexRunner.run(conf, new String[0], new String[0]);

    Map<Integer, Integer> data = Helpers.parseIntIntResults(output);
    assertEquals(3, data.size());
    assertEquals(1, (int) data.get(1));
View Full Code Here

  public void testCheckFailsJob() throws Exception {
    String tableName = "test1";
    hiveServer.createTable("CREATE TABLE " + tableName +
       " (i1 INT, i2 BIGINT) ");

    GiraphConfiguration conf = new GiraphConfiguration();
    String[] edges = new String[] {
        "1 2",
        "2 3",
        "2 4",
        "4 1"
    };

    GiraphHiveConstants.HIVE_VERTEX_OUTPUT_TABLE.set(conf, tableName);
    GiraphHiveConstants.VERTEX_TO_HIVE_CLASS.set(conf, HiveOutputIntIntVertex.class);

    conf.setComputationClass(ComputationCountEdges.class);
    conf.setOutEdgesClass(ByteArrayEdges.class);
    conf.setEdgeInputFormatClass(IntNullTextEdgeInputFormat.class);
    conf.setVertexOutputFormatClass(HiveVertexOutputFormat.class);
    try {
      Iterable<String> result = InternalVertexRunner.run(conf, null, edges);
      assertNull(result);
    } catch (IllegalArgumentException e) { }
  }
View Full Code Here

        "2\t2.22\t3:0.33,4:0.44",
        "4\t4.44\t1:0.11",
    };
    hiveServer.loadData(tableName, rows);

    GiraphConfiguration conf = new GiraphConfiguration();
    HIVE_VERTEX_INPUT.setTable(conf, tableName);
    HIVE_VERTEX_INPUT.setClass(conf, HiveIntDoubleDoubleVertex.class);
    conf.setComputationClass(ComputationSumEdges.class);
    conf.setVertexInputFormatClass(HiveVertexInputFormat.class);
    conf.setVertexOutputFormatClass(IdWithValueTextOutputFormat.class);
    Iterable<String> output = InternalVertexRunner.run(conf, new String[0], new String[0]);

    Map<Integer, Double> data = Helpers.parseIntDoubleResults(output);
    assertEquals(3, data.size());
    assertEquals(0.22, data.get(1));
View Full Code Here

  {
    String tableName = "test1";
    hiveServer.createTable("CREATE TABLE " + tableName +
       " (i1 BIGINT, i2 BIGINT) ");

    GiraphConfiguration conf = new GiraphConfiguration();
    runJob(tableName, conf);

    HiveInputDescription inputDesc = new HiveInputDescription();
    inputDesc.getTableDesc().setTableName(tableName);
View Full Code Here

    String tableName = "test1";
    hiveServer.createTable("CREATE TABLE " + tableName +
        " (i1 BIGINT, i2 BIGINT) " +
        " PARTITIONED BY (ds STRING) ");

    GiraphConfiguration conf = new GiraphConfiguration();
    GiraphHiveConstants.HIVE_VERTEX_OUTPUT_PARTITION.set(conf, "ds=foobar");

    runJob(tableName, conf);

    HiveInputDescription inputDesc = new HiveInputDescription();
View Full Code Here

        "2\t4",
        "4\t1",
    };
    hiveServer.loadData(tableName, rows);

    GiraphConfiguration conf = new GiraphConfiguration();
    HIVE_EDGE_INPUT.setTable(conf, tableName);
    HIVE_EDGE_INPUT.setClass(conf, HiveIntNullEdge.class);
    conf.setComputationClass(ComputationCountEdges.class);
    conf.setEdgeInputFormatClass(HiveEdgeInputFormat.class);
    conf.setVertexOutputFormatClass(IdWithValueTextOutputFormat.class);
    Iterable<String> output = InternalVertexRunner.run(conf, new String[0], new String[0]);

    Map<Integer, Integer> data = Helpers.parseIntIntResults(output);
    assertEquals(3, data.size());
    assertEquals(1, (int) data.get(1));
View Full Code Here

TOP

Related Classes of org.apache.giraph.conf.GiraphConfiguration

Copyright © 2018 www.massapicom. 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.