• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java GiraphConfiguration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.giraph.conf.GiraphConfiguration的典型用法代码示例。如果您正苦于以下问题:Java GiraphConfiguration类的具体用法?Java GiraphConfiguration怎么用?Java GiraphConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GiraphConfiguration类属于org.apache.giraph.conf包,在下文中一共展示了GiraphConfiguration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testMax

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Test
public void testMax() throws Exception {

    Vertex v1 = graph.addVertex(T.id, 1, T.label, "hi");
    Vertex v2 = graph.addVertex(T.id, 2, T.label, "world");
    Vertex v5 = graph.addVertex(T.id, 5, T.label, "bye");
    v5.addEdge("e", v1);
    v1.addEdge("e", v5);
    v1.addEdge("e", v2);
    v2.addEdge("e", v5);

    HBaseGraphConfiguration hconf = graph.configuration();
    GiraphConfiguration conf = new GiraphConfiguration(hconf.toHBaseConfiguration());
    conf.setComputationClass(MaxComputation.class);
    conf.setEdgeInputFormatClass(HBaseEdgeInputFormat.class);
    conf.setVertexInputFormatClass(HBaseVertexInputFormat.class);
    conf.setVertexOutputFormatClass(IdWithValueTextOutputFormat.class);

    Iterable<String> results = InternalHBaseVertexRunner.run(conf);

    Map<Integer, Integer> values = parseResults(results);
    assertEquals(3, values.size());
    assertEquals(5, (int) values.get(1));
    assertEquals(5, (int) values.get(2));
    assertEquals(5, (int) values.get(5));
}
 
开发者ID:rayokota,项目名称:hgraphdb,代码行数:27,代码来源:MaxComputationTest.java


示例2: testMax

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Test
public void testMax() throws Exception {
    HBaseGraphConfiguration hconf = graph.configuration();

    GiraphConfiguration conf = new GiraphConfiguration(hconf.toHBaseConfiguration());
    conf.setComputationClass(MaxComputation.class);
    conf.setEdgeInputFormatClass(HBaseEdgeInputFormat.class);
    conf.setVertexInputFormatClass(HBaseVertexInputFormat.class);
    conf.setEdgeOutputFormatClass(CreateEdgeOutputFormat.class);
    conf.setVertexOutputFormatClass(MaxPropertyVertexOutputFormat.class);

    Vertex v1 = graph.addVertex(T.id, 1, T.label, "hi");
    Vertex v2 = graph.addVertex(T.id, 2, T.label, "world");
    Vertex v5 = graph.addVertex(T.id, 5, T.label, "bye");
    v5.addEdge("e", v1);
    v1.addEdge("e", v5);
    v1.addEdge("e", v2);
    v2.addEdge("e", v5);

    InternalHBaseVertexRunner.run(conf);

    graph.vertices().forEachRemaining(v -> assertEquals(5, v.property("max").value()));
    assertEquals(4, IteratorUtils.count(IteratorUtils.filter(graph.edges(), e -> e.label().equals("e2"))));
}
 
开发者ID:rayokota,项目名称:hgraphdb,代码行数:25,代码来源:MaxComputationWithGraphOutputTest.java


示例3: run

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Override
public int run(String[] args) throws Exception {
	if (null == getConf()) {
		conf = new Configuration();
	}
	GiraphConfiguration giraphConf = new GiraphConfiguration(getConf());
	CommandLine cmd = ConfigurationUtils.parseArgs(giraphConf, args);

	if (null == cmd) {
		return 0;
	}
	final String vertexClassName = args[0];
	final String jobName = "Giraph: " + vertexClassName;

	GiraphJob job = new GiraphJob(giraphConf, jobName);
	prepareHadoopMRJob(job, cmd);
	boolean verbose = !cmd.hasOption('q');

	return job.run(verbose) ? 0 : -1;
}
 
开发者ID:tayllan,项目名称:comparative-study-of-frameworks-for-parallel-processing-of-graphs,代码行数:21,代码来源:MeuGiraphRunner.java


示例4: run

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Override
public int run(String[] args) throws Exception {
	if (null == getConf()) {
		conf = new Configuration();
	}
	GiraphConfiguration giraphConf = new GiraphConfiguration(getConf());
	CommandLine cmd = ConfigurationUtils.parseArgs(giraphConf, args);

	if (null == cmd) {
		return 0;
	}
	final String vertexClassName = args[0];
	final String jobName = "Giraph: " + vertexClassName;

	giraphConf.setMaxNumberOfSupersteps(MAX_NUMBER_SUPERSTEPS);

	GiraphJob job = new GiraphJob(giraphConf, jobName);
	prepareHadoopMRJob(job, cmd);
	boolean verbose = !cmd.hasOption('q');

	return job.run(verbose) ? 0 : -1;
}
 
开发者ID:tayllan,项目名称:comparative-study-of-frameworks-for-parallel-processing-of-graphs,代码行数:23,代码来源:MeuGiraphRunner.java


示例5: testEqualPageRankForSevenNodes

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Test
public void testEqualPageRankForSevenNodes() throws Exception {
    GiraphConfiguration conf = getConf();
    TestGraph<Text, DoubleWritable, Text> input = getTestGraph(conf);
    InMemoryVertexOutputFormat.initializeOutputGraph(conf);
    InternalVertexRunner.run(conf, input);
    TestGraph<Text, DoubleWritable, Text> output = InMemoryVertexOutputFormat.getOutputGraph();
    assertEquals(8, output.getVertices().size());
    assertTrue(output.getVertex(new Text("1")).getValue().get() < output.getVertex(new Text("8")).getValue().get());
    assertTrue(output.getVertex(new Text("1")).getValue().get() < output.getVertex(new Text("7")).getValue().get());
    assertTrue(output.getVertex(new Text("1")).getValue().get() < output.getVertex(new Text("6")).getValue().get());
    assertTrue(output.getVertex(new Text("1")).getValue().get() < output.getVertex(new Text("5")).getValue().get());
    assertTrue(output.getVertex(new Text("1")).getValue().get() < output.getVertex(new Text("4")).getValue().get());
    assertTrue(output.getVertex(new Text("1")).getValue().get() < output.getVertex(new Text("3")).getValue().get());
    assertTrue(output.getVertex(new Text("1")).getValue().get() < output.getVertex(new Text("2")).getValue().get());

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:18,代码来源:PageRankTest.java


示例6: testHighPageRankForOneNode

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Test
public void testHighPageRankForOneNode() throws Exception {
    GiraphConfiguration conf = getConf();
    TestGraph<Text, DoubleWritable, Text> input = getHighPageRankGraph(conf);
    InMemoryVertexOutputFormat.initializeOutputGraph(conf);
    InternalVertexRunner.run(conf, input);
    TestGraph<Text, DoubleWritable, Text> output = InMemoryVertexOutputFormat.getOutputGraph();
    assertEquals(8, output.getVertices().size());
    assertTrue(output.getVertex(new Text("8")).getValue().get() < output.getVertex(new Text("1")).getValue().get());
    assertTrue(output.getVertex(new Text("2")).getValue().get() < output.getVertex(new Text("1")).getValue().get());
    assertTrue(output.getVertex(new Text("3")).getValue().get() < output.getVertex(new Text("1")).getValue().get());
    assertTrue(output.getVertex(new Text("4")).getValue().get() < output.getVertex(new Text("1")).getValue().get());
    assertTrue(output.getVertex(new Text("5")).getValue().get() < output.getVertex(new Text("1")).getValue().get());
    assertTrue(output.getVertex(new Text("6")).getValue().get() < output.getVertex(new Text("1")).getValue().get());
    assertTrue(output.getVertex(new Text("7")).getValue().get() < output.getVertex(new Text("1")).getValue().get());

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:18,代码来源:PageRankTest.java


示例7: testBiggerGraph

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Test
public void testBiggerGraph() throws Exception {
    GiraphConfiguration conf = getConf();
    TestGraph<Text, LouvainNodeState, LongWritable> input = getBiggerGraph(conf);
    InMemoryVertexOutputFormat.initializeOutputGraph(conf);
    InternalVertexRunner.run(conf, input);
    TestGraph<Text, LouvainNodeState, Text> output = InMemoryVertexOutputFormat.getOutputGraph();
    assertTrue(output.getVertices().size() == 16);
    assertTrue(output.getVertex(new Text("1")).getValue().getCommunity().equals("1"));
    assertTrue(output.getVertex(new Text("2")).getValue().getCommunity().equals("2"));
    assertTrue(output.getVertex(new Text("3")).getValue().getCommunity().equals("3"));
    assertTrue(output.getVertex(new Text("4")).getValue().getCommunity().equals("4"));
    assertTrue(output.getVertex(new Text("5")).getValue().getCommunity().equals("5"));
    assertTrue(output.getVertex(new Text("6")).getValue().getCommunity().equals("6"));
    assertTrue(output.getVertex(new Text("7")).getValue().getCommunity().equals("7"));
    assertTrue(output.getVertex(new Text("8")).getValue().getCommunity().equals("8"));
    assertTrue(output.getVertex(new Text("9")).getValue().getCommunity().equals("9"));
    assertTrue(output.getVertex(new Text("10")).getValue().getCommunity().equals("10"));
    assertTrue(output.getVertex(new Text("11")).getValue().getCommunity().equals("11"));
    assertTrue(output.getVertex(new Text("12")).getValue().getCommunity().equals("12"));
    assertTrue(output.getVertex(new Text("13")).getValue().getCommunity().equals("13"));
    assertTrue(output.getVertex(new Text("14")).getValue().getCommunity().equals("14"));
    assertTrue(output.getVertex(new Text("15")).getValue().getCommunity().equals("15"));
    assertTrue(output.getVertex(new Text("16")).getValue().getCommunity().equals("16"));
}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:26,代码来源:LouvainTests.java


示例8: getBiggerGraph

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
private TestGraph<Text, LouvainNodeState, LongWritable> getBiggerGraph(GiraphConfiguration conf) {
    TestGraph<Text, LouvainNodeState, LongWritable> testGraph = new TestGraph<Text, LouvainNodeState, LongWritable>(conf);
    testGraph.addEdge(new Text("1"), new Text("2"), new LongWritable(1L));
    testGraph.addEdge(new Text("1"), new Text("3"), new LongWritable(1L));
    testGraph.addEdge(new Text("1"), new Text("4"), new LongWritable(1L));
    testGraph.addEdge(new Text("1"), new Text("5"), new LongWritable(1L));
    testGraph.addEdge(new Text("1"), new Text("6"), new LongWritable(1L));
    testGraph.addEdge(new Text("1"), new Text("7"), new LongWritable(1L));
    testGraph.addEdge(new Text("1"), new Text("8"), new LongWritable(1L));
    testGraph.addEdge(new Text("1"), new Text("9"), new LongWritable(1L));
    testGraph.addEdge(new Text("9"), new Text("10"), new LongWritable(1L));
    testGraph.addEdge(new Text("9"), new Text("11"), new LongWritable(1L));
    testGraph.addEdge(new Text("9"), new Text("12"), new LongWritable(1L));
    testGraph.addEdge(new Text("9"), new Text("13"), new LongWritable(1L));
    testGraph.addEdge(new Text("9"), new Text("14"), new LongWritable(1L));
    testGraph.addEdge(new Text("9"), new Text("15"), new LongWritable(1L));
    testGraph.addEdge(new Text("9"), new Text("16"), new LongWritable(1L));
    return testGraph;
}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:20,代码来源:LouvainTests.java


示例9: testComputeOutput

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Test
public void testComputeOutput() throws Exception {
    GiraphConfiguration conf = getConf();
    TestGraph<Text, VertexData, Text> input = getFirstTestGraph(conf);
    InMemoryVertexOutputFormat.initializeOutputGraph(conf);
    InternalVertexRunner.run(conf, input);
    TestGraph<Text, VertexData, Text> output = InMemoryVertexOutputFormat.getOutputGraph();
    assertEquals(8, output.getVertices().size());
    assertTrue(output.getVertex(new Text("2")).getValue().getApproxBetweenness() > 0.0);
    assertTrue(output.getVertex(new Text("1")).getValue().getApproxBetweenness() > 0.0);
    assertEquals(output.getVertex(new Text("3")).getValue().getApproxBetweenness(), 0.0, 0.0);
    assertEquals(output.getVertex(new Text("4")).getValue().getApproxBetweenness(), 0.0, 0.0);
    assertEquals(output.getVertex(new Text("5")).getValue().getApproxBetweenness(), 0.0, 0.0);
    assertEquals(output.getVertex(new Text("6")).getValue().getApproxBetweenness(), 0.0, 0.0);
    assertEquals(output.getVertex(new Text("7")).getValue().getApproxBetweenness(), 0.0, 0.0);
    assertEquals(output.getVertex(new Text("8")).getValue().getApproxBetweenness(), 0.0, 0.0);
}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:18,代码来源:HBSEComputeTest.java


示例10: testGraphWithShortestPathOne

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Test
public void testGraphWithShortestPathOne() throws Exception {
    GiraphConfiguration conf = getConf();
    TestGraph<Text, VertexData, Text> input = getShortestPathOneTestGraph(conf);
    InMemoryVertexOutputFormat.initializeOutputGraph(conf);
    InternalVertexRunner.run(conf, input);
    TestGraph<Text, VertexData, Text> output = InMemoryVertexOutputFormat.getOutputGraph();
    assertEquals(8, output.getVertices().size());
    assertNotSame(output.getVertex(new Text("1")).getValue().getApproxBetweenness(), 0.0);
    assertEquals(output.getVertex(new Text("2")).getValue().getApproxBetweenness(), 0.0, 0.0);
    assertEquals(output.getVertex(new Text("3")).getValue().getApproxBetweenness(), 0.0, 0.0);
    assertEquals(output.getVertex(new Text("4")).getValue().getApproxBetweenness(), 0.0, 0.0);
    assertEquals(output.getVertex(new Text("5")).getValue().getApproxBetweenness(), 0.0, 0.0);
    assertEquals(output.getVertex(new Text("6")).getValue().getApproxBetweenness(), 0.0, 0.0);
    assertEquals(output.getVertex(new Text("7")).getValue().getApproxBetweenness(), 0.0, 0.0);
    assertEquals(output.getVertex(new Text("8")).getValue().getApproxBetweenness(), 0.0, 0.0);

}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:19,代码来源:HBSEComputeTest.java


示例11: getTwoCriticalPointGraph

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
private TestGraph<Text, VertexData, Text> getTwoCriticalPointGraph(GiraphConfiguration conf) {
    TestGraph<Text, VertexData, Text> testGraph = new TestGraph<Text, VertexData, Text>(conf);
    testGraph.addEdge(new Text("1"), new Text("2"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("3"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("4"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("5"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("6"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("7"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("8"), new Text("1"));
    testGraph.addEdge(new Text("9"), new Text("10"), new Text("1"));
    testGraph.addEdge(new Text("9"), new Text("11"), new Text("1"));
    testGraph.addEdge(new Text("9"), new Text("12"), new Text("1"));
    testGraph.addEdge(new Text("9"), new Text("13"), new Text("1"));
    testGraph.addEdge(new Text("9"), new Text("14"), new Text("1"));
    testGraph.addEdge(new Text("9"), new Text("15"), new Text("1"));
    testGraph.addEdge(new Text("9"), new Text("16"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("9"), new Text("1"));
    testGraph.addEdge(new Text("9"), new Text("1"), new Text("1"));
    return testGraph;
}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:21,代码来源:HBSEComputeTest.java


示例12: getShortestPathOneTestGraph

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
private TestGraph<Text, VertexData, Text> getShortestPathOneTestGraph(GiraphConfiguration conf) {
    TestGraph<Text, VertexData, Text> testGraph = new TestGraph<Text, VertexData, Text>(conf);
    testGraph.addEdge(new Text("1"), new Text("2"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("3"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("4"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("5"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("6"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("7"), new Text("1"));
    testGraph.addEdge(new Text("1"), new Text("8"), new Text("1"));
    testGraph.addEdge(new Text("2"), new Text("1"), new Text("1"));
    testGraph.addEdge(new Text("3"), new Text("1"), new Text("1"));
    testGraph.addEdge(new Text("4"), new Text("1"), new Text("1"));
    testGraph.addEdge(new Text("5"), new Text("1"), new Text("1"));
    testGraph.addEdge(new Text("6"), new Text("1"), new Text("1"));
    testGraph.addEdge(new Text("7"), new Text("1"), new Text("1"));
    testGraph.addEdge(new Text("8"), new Text("1"), new Text("1"));
    return testGraph;
}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:19,代码来源:HBSEComputeTest.java


示例13: testComputeOutput

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Test
public void testComputeOutput() throws Exception {
    GiraphConfiguration conf = new GiraphConfiguration();
    conf.setComputationClass(WeaklyConnectedComponentComputation.class);
    conf.setVertexOutputFormatClass(InMemoryVertexOutputFormat.class);
    TestGraph<Text,Text,Text> testGraph = getGraph(conf);
    InMemoryVertexOutputFormat.initializeOutputGraph(conf);
    InternalVertexRunner.run(conf, testGraph);
    TestGraph<Text, Text, Text> graph = InMemoryVertexOutputFormat.getOutputGraph();
    assertEquals(6, graph.getVertices().size());
    assertEquals("2", graph.getVertex(new Text("1")).getValue().toString());
    assertEquals("2", graph.getVertex(new Text("2")).getValue().toString());
    assertEquals("4", graph.getVertex(new Text("3")).getValue().toString());
    assertEquals("4", graph.getVertex(new Text("4")).getValue().toString());
    assertEquals("6", graph.getVertex(new Text("5")).getValue().toString());
    assertEquals("6", graph.getVertex(new Text("6")).getValue().toString());
}
 
开发者ID:Sotera,项目名称:distributed-graph-analytics,代码行数:18,代码来源:WeaklyConnectedComponentComputationTest.java


示例14: testMaxSuperstep

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
/**
 * Run a job that tests that this job completes in the desired number of
 * supersteps
 *
 * @throws java.io.IOException
 * @throws ClassNotFoundException
 * @throws InterruptedException
 */
@Test
public void testMaxSuperstep()
        throws IOException, InterruptedException, ClassNotFoundException {
  GiraphConfiguration conf = new GiraphConfiguration();
  conf.setVertexClass(InfiniteLoopVertex.class);
  conf.setVertexInputFormatClass(SimplePageRankVertexInputFormat.class);
  conf.setVertexOutputFormatClass(SimplePageRankVertexOutputFormat.class);
  GiraphJob job = prepareJob(getCallingMethodName(), conf,
      getTempPath(getCallingMethodName()));
  job.getConfiguration().setMaxNumberOfSupersteps(3);
  assertTrue(job.run(true));
  if (!runningInDistributedMode()) {
    GiraphHadoopCounter superstepCounter =
        GiraphStats.getInstance().getSuperstepCounter();
    assertEquals(superstepCounter.getValue(), 3L);
  }
}
 
开发者ID:zfighter,项目名称:giraph-research,代码行数:26,代码来源:TestMaxSuperstep.java


示例15: testBspFail

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
/**
 * Run a sample BSP job in JobTracker, kill a task, and make sure
 * the job fails (not enough attempts to restart)
 *
 * @throws IOException
 * @throws ClassNotFoundException
 * @throws InterruptedException
 */
@Test
public void testBspFail()
    throws IOException, InterruptedException, ClassNotFoundException {
  // Allow this test only to be run on a real Hadoop setup
  if (!runningInDistributedMode()) {
    System.out.println("testBspFail: not executed for local setup.");
    return;
  }

  GiraphConfiguration conf = new GiraphConfiguration();
  conf.setVertexClass(SimpleFailVertex.class);
  conf.setVertexInputFormatClass(SimplePageRankVertexInputFormat.class);
  GiraphJob job = prepareJob(getCallingMethodName(), conf,
      getTempPath(getCallingMethodName()));
  job.getConfiguration().setInt("mapred.map.max.attempts", 1);
  assertTrue(!job.run(true));
}
 
开发者ID:zfighter,项目名称:giraph-research,代码行数:26,代码来源:TestBspBasic.java


示例16: testAggregatorsHandling

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
/** Tests if aggregators are handled on a proper way during supersteps */
@Test
public void testAggregatorsHandling() throws IOException,
    ClassNotFoundException, InterruptedException {
  GiraphConfiguration conf = new GiraphConfiguration();
  conf.setVertexClass(AggregatorsTestVertex.class);
  conf.setVertexInputFormatClass(
      SimplePageRankVertex.SimplePageRankVertexInputFormat.class);
  GiraphJob job = prepareJob(getCallingMethodName(), conf);
  job.getConfiguration().setMasterComputeClass(
      AggregatorsTestVertex.AggregatorsTestMasterCompute.class);
  // test with aggregators split in a few requests
  job.getConfiguration().setInt(
      AggregatorUtils.MAX_BYTES_PER_AGGREGATOR_REQUEST, 50);
  assertTrue(job.run(true));
}
 
开发者ID:zfighter,项目名称:giraph-research,代码行数:17,代码来源:TestAggregatorsHandling.java


示例17: prepareConfiguration

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Override
protected void prepareConfiguration(GiraphConfiguration conf,
    CommandLine cmd) {
  conf.setVertexClass(RandomMessageVertex.class);
  conf.setVertexInputFormatClass(PseudoRandomVertexInputFormat.class);
  conf.setWorkerContextClass(RandomMessageBenchmarkWorkerContext.class);
  conf.setMasterComputeClass(RandomMessageBenchmarkMasterCompute.class);
  conf.setLong(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES,
      BenchmarkOption.VERTICES.getOptionLongValue(cmd));
  conf.setLong(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX,
      BenchmarkOption.EDGES_PER_VERTEX.getOptionLongValue(cmd));
  conf.setInt(SUPERSTEP_COUNT,
      BenchmarkOption.SUPERSTEPS.getOptionIntValue(cmd));
  conf.setInt(RandomMessageBenchmark.NUM_BYTES_PER_MESSAGE,
      BYTES_PER_MESSAGE.getOptionIntValue(cmd));
  conf.setInt(RandomMessageBenchmark.NUM_MESSAGES_PER_EDGE,
      MESSAGES_PER_EDGE.getOptionIntValue(cmd));
  if (FLUSH_THREADS.optionTurnedOn(cmd)) {
    conf.setInt(GiraphConstants.MSG_NUM_FLUSH_THREADS,
        FLUSH_THREADS.getOptionIntValue(cmd));
  }
}
 
开发者ID:zfighter,项目名称:giraph-research,代码行数:23,代码来源:RandomMessageBenchmark.java


示例18: prepareConfiguration

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Override
protected void prepareConfiguration(GiraphConfiguration conf,
    CommandLine cmd) {
  conf.setVertexClass(PageRankVertex.class);
  conf.setOutEdgesClass(IntNullArrayEdges.class);
  conf.setCombinerClass(FloatSumCombiner.class);
  conf.setVertexInputFormatClass(
      PseudoRandomIntNullVertexInputFormat.class);

  conf.setInt(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES,
      BenchmarkOption.VERTICES.getOptionIntValue(cmd));
  conf.setInt(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX,
      BenchmarkOption.EDGES_PER_VERTEX.getOptionIntValue(cmd));
  conf.setInt(PageRankVertex.SUPERSTEP_COUNT,
      BenchmarkOption.SUPERSTEPS.getOptionIntValue(cmd));
  conf.setFloat(PseudoRandomInputFormatConstants.LOCAL_EDGES_MIN_RATIO,
      BenchmarkOption.LOCAL_EDGES_MIN_RATIO.getOptionFloatValue(cmd,
          PseudoRandomInputFormatConstants.LOCAL_EDGES_MIN_RATIO_DEFAULT));
}
 
开发者ID:zfighter,项目名称:giraph-research,代码行数:20,代码来源:PageRankBenchmark.java


示例19: testBspSuperStep

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
/**
 * Run a sample BSP job locally and test supersteps.
 *
 * @throws IOException
 * @throws ClassNotFoundException
 * @throws InterruptedException
 */
@Test
public void testBspSuperStep()
    throws IOException, InterruptedException, ClassNotFoundException {
  String callingMethod = getCallingMethodName();
  Path outputPath = getTempPath(callingMethod);
  GiraphConfiguration conf = new GiraphConfiguration();
  conf.setComputationClass(SimpleSuperstepComputation.class);
  conf.setVertexInputFormatClass(SimpleSuperstepVertexInputFormat.class);
  conf.setVertexOutputFormatClass(SimpleSuperstepVertexOutputFormat.class);
  GiraphJob job = prepareJob(callingMethod, conf, outputPath);
  Configuration configuration = job.getConfiguration();
  // GeneratedInputSplit will generate 10 vertices
  GeneratedVertexReader.READER_VERTICES.set(configuration, 10);
  assertTrue(job.run(true));
  if (!runningInDistributedMode()) {
    FileStatus fileStatus = getSinglePartFileStatus(configuration, outputPath);
    assertEquals(49l, fileStatus.getLen());
  }
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:27,代码来源:TestBspBasic.java


示例20: getEmptyDb

import org.apache.giraph.conf.GiraphConfiguration; //导入依赖的package包/类
@Test
public void getEmptyDb() throws Exception {
  Iterable<String>    results;
  Iterator<String>    result;
  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");
  conf.set("io.serializations",
      "org.apache.hadoop.io.serializer.WritableSerialization," +
      "org.apache.hadoop.io.serializer.JavaSerialization");
  conf.setComputationClass(EmptyComputation.class);
  conf.setVertexInputFormatClass(GoraTestVertexInputFormat.class);
  results = InternalVertexRunner.run(conf, new String[0], new String[0]);
  Assert.assertNotNull(results);
  result = results.iterator();
  Assert.assertFalse(result.hasNext());
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:25,代码来源:TestGoraVertexInputFormat.java



注:本文中的org.apache.giraph.conf.GiraphConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RAFImageInputStreamSpi类代码示例发布时间:2022-05-21
下一篇:
Java Task类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap