Package org.apache.giraph.conf

Examples of org.apache.giraph.conf.GiraphConfiguration


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

    GiraphConfiguration conf = new GiraphConfiguration();
    conf.setVertexOutputFormatThreadSafe(true);
    conf.setNumOutputThreads(2);
    GiraphConstants.USER_PARTITION_COUNT.set(conf, 4);
    runJob(tableName, conf);

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


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

    GiraphConfiguration conf = new GiraphConfiguration();
    HIVE_EDGE_INPUT.setTable(conf, tableName);
    HIVE_EDGE_INPUT.setPartition(conf, partition);
    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

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

    GiraphConfiguration conf = new GiraphConfiguration();
    HIVE_EDGE_INPUT.setTable(conf, tableName);
    HIVE_EDGE_INPUT.setClass(conf, HiveIntDoubleEdge.class);
    conf.setComputationClass(ComputationSumEdges.class);
    conf.setEdgeInputFormatClass(HiveEdgeInputFormat.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

    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

    }

    GiraphJob job = new GiraphJob(getConf(), getClass().getName());
    int workers = Integer.parseInt(BenchmarkOption.WORKERS.getOptionValue(cmd));

    GiraphConfiguration giraphConf = job.getConfiguration();
    giraphConf.addWorkerObserverClass(LogVersions.class);
    giraphConf.addMasterObserverClass(LogVersions.class);

    giraphConf.setWorkerConfiguration(workers, workers, 100.0f);
    prepareConfiguration(giraphConf, cmd);

    boolean isVerbose = false;
    if (BenchmarkOption.VERBOSE.optionTurnedOn(cmd)) {
      isVerbose = true;
View Full Code Here

    Mockito.when(env.getContext().getConfiguration())
        .thenReturn(env.getConfiguration());
    computation.initialize(env.getGraphState(),
        env.getWorkerClientRequestProcessor(), null, null, null);

    GiraphConfiguration giraphConf = new GiraphConfiguration();
    giraphConf.setComputationClass(computation.getClass());
    giraphConf.setOutEdgesClass(ArrayListEdges.class);
    ImmutableClassesGiraphConfiguration<I, V, E> conf =
        new ImmutableClassesGiraphConfiguration<I, V, E>(giraphConf);
    computation.setConf(conf);

    vertex.setConf(conf);
View Full Code Here

    ArrayList<Element> result = convertIterator(results.iterator());
    checkResult(expected, result);
  }

  private void testDbOutput(String name) throws Exception {
    GiraphConfiguration conf = new GiraphConfiguration();
    GIRAPH_REXSTER_HOSTNAME.set(conf, "127.0.0.1");
    GIRAPH_REXSTER_PORT.set(conf, 18182);
    GIRAPH_REXSTER_OUTPUT_GRAPH.set(conf, name);
    conf.setComputationClass(EmptyComputation.class);
    conf.setVertexInputFormatClass(
      JsonLongDoubleFloatDoubleVertexInputFormat.class);
    conf.setVertexOutputFormatClass(
      RexsterLongDoubleFloatVertexOutputFormat.class);
    conf.setEdgeOutputFormatClass(
      RexsterLongDoubleFloatEdgeOutputFormat.class);

    /* graph used for testing */
    String[] graph = new String[] {
      "[1,0,[[2,1],[4,3]]]",
View Full Code Here

  public static class DummyComputation extends NoOpComputation<Text,
      DoubleWritable, DoubleWritable, DoubleWritable> { }

  @Before
  public void setUp() {
    GiraphConfiguration giraphConfiguration = new GiraphConfiguration();
    giraphConfiguration.setComputationClass(DummyComputation.class);
    conf = new ImmutableClassesGiraphConfiguration<Text, DoubleWritable,
        Writable>(giraphConfiguration);
  }
View Full Code Here

public class TestGoraVertexOutputFormat {

  @Test
  public void getWritingDb() throws Exception {
    Iterable<String>    results;
    GiraphConfiguration conf    = new GiraphConfiguration();
    GIRAPH_GORA_DATASTORE_CLASS.
    set(conf, "org.apache.gora.memory.store.MemStore");
    GIRAPH_GORA_KEYS_FACTORY_CLASS.
    set(conf,"org.apache.giraph.io.gora.utils.DefaultKeyFactory");
    GIRAPH_GORA_KEY_CLASS.set(conf,"java.lang.String");
    GIRAPH_GORA_PERSISTENT_CLASS.
    set(conf,"org.apache.giraph.io.gora.generated.GVertex");
    GIRAPH_GORA_START_KEY.set(conf,"1");
    GIRAPH_GORA_END_KEY.set(conf,"10");
    GIRAPH_GORA_OUTPUT_DATASTORE_CLASS.
    set(conf, "org.apache.gora.memory.store.MemStore");
    GIRAPH_GORA_OUTPUT_KEY_CLASS.set(conf, "java.lang.String");
    GIRAPH_GORA_OUTPUT_PERSISTENT_CLASS.
    set(conf, "org.apache.giraph.io.gora.generated.GVertex");
    conf.set("io.serializations",
        "org.apache.hadoop.io.serializer.WritableSerialization," +
        "org.apache.hadoop.io.serializer.JavaSerialization");
    conf.setComputationClass(EmptyComputation.class);
    conf.setVertexInputFormatClass(GoraTestVertexInputFormat.class);
    // Parameters for output
    GIRAPH_GORA_OUTPUT_DATASTORE_CLASS.
    set(conf, "org.apache.gora.memory.store.MemStore");
    GIRAPH_GORA_OUTPUT_KEY_CLASS.set(conf, "java.lang.String");
    GIRAPH_GORA_OUTPUT_PERSISTENT_CLASS.
    set(conf,"org.apache.giraph.io.gora.generated.GVertex");
    conf.setVertexOutputFormatClass(GoraTestVertexOutputFormat.class);
    results = InternalVertexRunner.run(conf, new String[0], new String[0]);
    Assert.assertNotNull(results);
  }
View Full Code Here

public class TestGoraEdgeOutputFormat {

  @Test
  public void getWritingDb() throws Exception {
    Iterable<String>    results;
    GiraphConfiguration conf    = new GiraphConfiguration();
    // Parameters for input
    GIRAPH_GORA_DATASTORE_CLASS.
    set(conf, "org.apache.gora.memory.store.MemStore");
    GIRAPH_GORA_KEYS_FACTORY_CLASS.
    set(conf,"org.apache.giraph.io.gora.utils.DefaultKeyFactory");
    GIRAPH_GORA_KEY_CLASS.set(conf,"java.lang.String");
    GIRAPH_GORA_PERSISTENT_CLASS.
    set(conf,"org.apache.giraph.io.gora.generated.GEdge");
    GIRAPH_GORA_START_KEY.set(conf,"1");
    GIRAPH_GORA_END_KEY.set(conf,"4");
    conf.set("io.serializations",
        "org.apache.hadoop.io.serializer.WritableSerialization," +
        "org.apache.hadoop.io.serializer.JavaSerialization");
    conf.setComputationClass(EmptyComputation.class);
    conf.setEdgeInputFormatClass(GoraTestEdgeInputFormat.class);
    // Parameters for output
    GIRAPH_GORA_OUTPUT_DATASTORE_CLASS.
    set(conf, "org.apache.gora.memory.store.MemStore");
    GIRAPH_GORA_OUTPUT_KEY_CLASS.set(conf, "java.lang.String");
    GIRAPH_GORA_OUTPUT_PERSISTENT_CLASS.
    set(conf,"org.apache.giraph.io.gora.generated.GEdgeResult");
    conf.setEdgeOutputFormatClass(GoraTestEdgeOutputFormat.class);
    results = InternalVertexRunner.run(conf, new String[0], new String[0]);
    Assert.assertNotNull(results);
  }
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.