Package org.apache.giraph.conf

Examples of org.apache.giraph.conf.ImmutableClassesGiraphConfiguration


  @Before
  public void setUp() throws IOException {
    // Setup the conf
    GiraphConfiguration tmpConf = new GiraphConfiguration();
    GiraphConstants.VERTEX_CLASS.set(tmpConf, TestVertex.class);
    conf = new ImmutableClassesGiraphConfiguration(tmpConf);

    @SuppressWarnings("rawtypes")
    Context context = mock(Context.class);
    when(context.getConfiguration()).thenReturn(conf);
View Full Code Here


  @Before
  public void setUp() {
    GiraphConfiguration tmpConfig = new GiraphConfiguration();
    tmpConfig.setVertexClass(IntVertex.class);
    conf = new ImmutableClassesGiraphConfiguration(tmpConfig);
  }
View Full Code Here

    GiraphConfiguration conf = new GiraphConfiguration();
    conf.setVertexClass(SimpleSuperstepVertex.class);
    conf.setVertexInputFormatClass(
        SimpleSuperstepVertex.SimpleSuperstepVertexInputFormat.class);
    GiraphJob job = prepareJob(getCallingMethodName(), conf);
    ImmutableClassesGiraphConfiguration configuration =
        new ImmutableClassesGiraphConfiguration(job.getConfiguration());
    Vertex<LongWritable, IntWritable, FloatWritable, IntWritable> vertex =
        configuration.createVertex();
    vertex.initialize(new LongWritable(1), new IntWritable(1));
    System.out.println("testInstantiateVertex: Got vertex " + vertex);
    VertexInputFormat<LongWritable, IntWritable, FloatWritable>
    inputFormat = configuration.createVertexInputFormat();
/*if[HADOOP_NON_JOBCONTEXT_IS_INTERFACE]
      List<InputSplit> splitArray =
          inputFormat.getSplits(
              new JobContext(new Configuration(), new JobID()), 1);
else[HADOOP_NON_JOBCONTEXT_IS_INTERFACE]*/
 
View Full Code Here

  @Before
  public void setUp() {
    GiraphConfiguration tmpConfig = new GiraphConfiguration();
    tmpConfig.setVertexClass(IntVertex.class);
    GiraphConstants.AUTHENTICATE.set(tmpConfig, true);
    conf = new ImmutableClassesGiraphConfiguration(tmpConfig);
  }
View Full Code Here

            GeneratedVertexMatchCombiner.class);
      @SuppressWarnings("rawtypes")
      GiraphConfigurationValidator<?, ?, ?, ?> validator =
        new GiraphConfigurationValidator(conf);

      ImmutableClassesGiraphConfiguration gc = new
          ImmutableClassesGiraphConfiguration(conf);


      validator.validateConfiguration();
    }
View Full Code Here

    Configuration.addDefaultResource("giraph-site.xml");
    GiraphConfiguration initConfig = new GiraphConfiguration();
    initConfig.setVertexClass(IntVertex.class);
    GiraphConstants.MESSAGES_DIRECTORY.set(
        initConfig, new File(directory, "giraph_messages").toString());
    config = new ImmutableClassesGiraphConfiguration(initConfig);

    testData = new TestData();
    testData.maxId = 1000000;
    testData.maxMessage = 1000000;
    testData.maxNumberOfMessages = 100;
View Full Code Here

  private Vertex<LongWritable, FloatWritable, DoubleWritable, LongWritable>
  instantiateVertex(Class<? extends OutEdges> edgesClass) {
    GiraphConfiguration giraphConfiguration = new GiraphConfiguration();
    giraphConfiguration.setVertexClass(TestVertex.class);
    giraphConfiguration.setOutEdgesClass(edgesClass);
    ImmutableClassesGiraphConfiguration immutableClassesGiraphConfiguration =
        new ImmutableClassesGiraphConfiguration(giraphConfiguration);
    return immutableClassesGiraphConfiguration.createVertex();
  }
View Full Code Here

  instantiateOutEdges(Class<? extends OutEdges> edgesClass) {
    GiraphConfiguration giraphConfiguration = new GiraphConfiguration();
    // Needed to extract type arguments in ReflectionUtils.
    giraphConfiguration.setVertexClass(TestVertex.class);
    giraphConfiguration.setOutEdgesClass(edgesClass);
    ImmutableClassesGiraphConfiguration immutableClassesGiraphConfiguration =
        new ImmutableClassesGiraphConfiguration(giraphConfiguration);
    return immutableClassesGiraphConfiguration.createOutEdges();
  }
View Full Code Here

   * unchecked exception to end job run on failure.
   *
   * @param conf the Configuration for this run.
   */
  public GiraphConfigurationValidator(Configuration conf) {
    this.conf = new ImmutableClassesGiraphConfiguration(conf);
  }
View Full Code Here

            "old value = " + oldMaxTaskAttempts + ")");
      }
    }

    // Set the job properties, check them, and submit the job
    ImmutableClassesGiraphConfiguration conf =
        new ImmutableClassesGiraphConfiguration(giraphConfiguration);
    checkLocalJobRunnerConfiguration(conf);
    Job submittedJob = new Job(conf, jobName);
    if (submittedJob.getJar() == null) {
      submittedJob.setJarByClass(getClass());
    }
    submittedJob.setNumReduceTasks(0);
    submittedJob.setMapperClass(GraphMapper.class);
    submittedJob.setInputFormatClass(BspInputFormat.class);
    submittedJob.setOutputFormatClass(BspOutputFormat.class);

    GiraphJobObserver jobObserver = conf.getJobObserver();
    jobObserver.launchingJob(submittedJob);
    boolean passed = submittedJob.waitForCompletion(verbose);
    jobObserver.jobFinished(submittedJob, passed);

    return passed;
View Full Code Here

TOP

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

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.