Package org.apache.hama

Examples of org.apache.hama.HamaConfiguration


      }
    }
  }

  public static void main(String[] args) throws Exception {
    HamaConfiguration conf = new HamaConfiguration();
    parseArgs(conf, args);
    startTask(conf);
  }
View Full Code Here


  private HamaConfiguration configuration;
  private static FileSystem fs = null;
  private String examplesInstallPath;

  public TestPipes() {
    configuration = new HamaConfiguration();

    try {
      // Cleanup temp Hama locations
      fs = FileSystem.get(configuration);
      cleanup(fs, new Path(HAMA_TMP_OUTPUT));
View Full Code Here

  }

  static void runProgram(BSPJob bsp, Path program, Path inputPath,
      Path outputPath, int numBspTasks, int numOfGroom) throws IOException,
      ClassNotFoundException, InterruptedException {
    HamaConfiguration conf = (HamaConfiguration) bsp.getConfiguration();
    bsp.setJobName("Test Hama Pipes " + program.getName());
    bsp.setBspClass(PipesBSP.class);

    FileInputFormat.setInputPaths(bsp, inputPath);
    FileOutputFormat.setOutputPath(bsp, outputPath);
View Full Code Here

  }

  public static GraphJob getJob(String inpath, String outpath,
      Optional<Integer> numBspTasks) throws IOException {
    // Graph job configuration
    HamaConfiguration conf = new HamaConfiguration();
    GraphJob inlinkJob = new GraphJob(conf, InlinkCount.class);
    // Set the job name
    inlinkJob.setJobName("Inlink Count");

    inlinkJob.setInputPath(new Path(inpath));
View Full Code Here

    if (args.length < 2) {
      printUsage();
    }

    HamaConfiguration conf = new HamaConfiguration(new Configuration());

    GraphJob job = createJob(args, conf);

    long startTime = System.currentTimeMillis();
    if (job.waitForCompletion(true)) {
View Full Code Here

  public static void main(String[] args) throws IOException,
      InterruptedException, ClassNotFoundException {
    if (args.length < 2)
      printUsage();

    HamaConfiguration conf = new HamaConfiguration();
    GraphJob pageJob = createJob(args, conf);

    long startTime = System.currentTimeMillis();
    if (pageJob.waitForCompletion(true)) {
      System.out.println("Job Finished in "
View Full Code Here

      System.out.println("USAGE: <INPUT_PATH> [<REGRESSION_MODEL>]");
      return;
    }

    // BSP job configuration
    HamaConfiguration conf = new HamaConfiguration();
    conf.setFloat(GradientDescentBSP.ALPHA, 0.002f);
    conf.setFloat(GradientDescentBSP.COST_THRESHOLD, 0.5f);
    conf.setInt(GradientDescentBSP.ITERATIONS_THRESHOLD, 300);
    conf.setInt(GradientDescentBSP.INITIAL_THETA_VALUES, 10);
    if (args.length == 2 && args[1] != null) {
      if (args[1].equals("logistic")) {
        conf.setClass(GradientDescentBSP.REGRESSION_MODEL_CLASS,
            LogisticRegressionModel.class, RegressionModel.class);
      } else if (args[1].equals("linear")) {
        // do nothing as 'linear' is default
      } else {
        throw new RuntimeException(new StringBuilder(
View Full Code Here

    outputBuffer.close();
  }

  public void testSpillBuffer() throws Exception {

    Configuration conf = new HamaConfiguration();
    String fileName = System.getProperty("java.io.tmpdir") + File.separatorChar
        + new BigInteger(128, new SecureRandom()).toString(32);
    SpilledDataProcessor processor = new WriteSpilledDataProcessor(fileName);
    processor.init(conf);
    SpillingDataOutputBuffer outputBuffer = new SpillingDataOutputBuffer(2,
View Full Code Here

    }
    intWritable.write(stream);
    stream.close();
    buffer.flip();

    Configuration conf = new HamaConfiguration();

    conf.setClass(Constants.MESSAGE_CLASS, IntWritable.class, Writable.class);
    conf.setClass(Constants.COMBINER_CLASS, SumCombiner.class, Combiner.class);

    CombineSpilledDataProcessor<IntWritable> processor = new CombineSpilledDataProcessor<IntWritable>(
        fileName);
    assertTrue(processor.init(conf));
    File f = new File(fileName);
View Full Code Here

    File f = null;
    try {
      String fileName = System.getProperty("java.io.tmpdir")
          + File.separatorChar + "testSpillInputStream.txt";
      Configuration conf = new HamaConfiguration();
      SpilledDataProcessor processor = new WriteSpilledDataProcessor(fileName);
      processor.init(conf);
      SpillingDataOutputBuffer outputBuffer = new SpillingDataOutputBuffer(2,
          1024, 1024, true, processor);
      Text text = new Text("Testing the spillage of spilling buffer");
View Full Code Here

TOP

Related Classes of org.apache.hama.HamaConfiguration

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.