Examples of HamaConfiguration


Examples of org.apache.hama.HamaConfiguration

    }
  }

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

Examples of org.apache.hama.HamaConfiguration

    }

    conf.set("modelPath", this.modelPath);
    this.writeModelToFile();

    HamaConfiguration hamaConf = new HamaConfiguration(conf);

    // create job
    BSPJob job = new BSPJob(hamaConf, SmallLayeredNeuralNetworkTrainer.class);
    job.setJobName("Small scale Neural Network training");
    job.setJarByClass(SmallLayeredNeuralNetworkTrainer.class);
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  public void testSemiClustering() throws IOException, InterruptedException,
      ClassNotFoundException {
    generateTestData();
    try {

      HamaConfiguration conf = new HamaConfiguration();
      conf.setInt(semiClusterMaximumVertexCount, 100);
      conf.setInt(graphJobMessageSentCount, 100);
      conf.setInt(graphJobVertexMaxClusterCount, 1);
      GraphJob semiClusterJob = new GraphJob(conf, SemiClusterJobDriver.class);
      semiClusterJob.setMaxIteration(15);
     
      semiClusterJob.setCompressionCodec(SnappyCompressor.class);
      semiClusterJob.setCompressionThreshold(10);
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  /**
   * Creates a basic job with sequencefiles as in and output.
   */
  public static BSPJob createJob(Configuration cnf, Path in, Path out,
      boolean textOut) throws IOException {
    HamaConfiguration conf = new HamaConfiguration(cnf);
    BSPJob job = new BSPJob(conf, KMeansBSP.class);
    job.setJobName("KMeans Clustering");
    job.setJarByClass(KMeansBSP.class);
    job.setBspClass(KMeansBSP.class);
    job.setInputPath(in);
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

    @Override
    public void setup(
        BSPPeer<IntWritable, SparseVectorWritable, IntWritable, DoubleWritable, NullWritable> peer)
        throws IOException, SyncException, InterruptedException {
      // reading input vector, which represented as matrix row
      HamaConfiguration conf = (HamaConfiguration) peer.getConfiguration();
      v = new DenseVectorWritable();
      readFromFile(conf.get(inputVectorPathString), v, conf);
      peer.sync();
    }
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  public static void main(String[] args) throws IOException,
      InterruptedException, ClassNotFoundException {
    if (args.length != 2) {
      printUsage();
    }
    HamaConfiguration conf = new HamaConfiguration(new Configuration());
    GraphJob graphJob = createJob(args, conf);
    long startTime = System.currentTimeMillis();
    if (graphJob.waitForCompletion(true)) {
      System.out.println("Job Finished in "
          + (System.currentTimeMillis() - startTime) / 1000.0 + " seconds");
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  }

  public static void main(String[] args) throws InterruptedException,
      IOException, ClassNotFoundException {
    // BSP job configuration
    HamaConfiguration conf = new HamaConfiguration();

    BSPJob bsp = new BSPJob(conf, PiEstimator.class);
    bsp.setCompressionCodec(SnappyCompressor.class);
    bsp.setCompressionThreshold(40);
   
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

      InterruptedException, ClassNotFoundException {
    if (args.length < 3)
      printUsage();

    // Graph job configuration
    HamaConfiguration conf = new HamaConfiguration();
    GraphJob ssspJob = new GraphJob(conf, SSSP.class);
    // Set the job name
    ssspJob.setJobName("Single Source Shortest Path");

    conf.set(START_VERTEX, args[0]);
    ssspJob.setInputPath(new Path(args[1]));
    ssspJob.setOutputPath(new Path(args[2]));

    if (args.length == 4) {
      ssspJob.setNumBspTask(Integer.parseInt(args[3]));
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

    if (mode.equalsIgnoreCase("label")) {
      if (args.length < 4) {
        printUsage();
        return;
      }
      HamaConfiguration conf = new HamaConfiguration();

      String featureDataPath = args[1];
      String resultDataPath = args[2];
      String modelPath = args[3];
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

    if (args.length < 4 || (args.length > 4 && args.length != 7)) {
      System.out
          .println("USAGE: <INPUT_PATH> <OUTPUT_PATH> <MAXITERATIONS> <K (how many centers)> -g [<COUNT> <DIMENSION OF VECTORS>]");
      return;
    }
    HamaConfiguration conf = new HamaConfiguration();

    Path in = new Path(args[0]);
    Path out = new Path(args[1]);
    FileSystem fs = FileSystem.get(conf);
    Path center = null;
    if (fs.isFile(in)) {
      center = new Path(in.getParent(), "center/cen.seq");
    } else {
      center = new Path(in, "center/cen.seq");
    }
    Path centerOut = new Path(out, "center/center_output.seq");
    conf.set(KMeansBSP.CENTER_IN_PATH, center.toString());
    conf.set(KMeansBSP.CENTER_OUT_PATH, centerOut.toString());
    int iterations = Integer.parseInt(args[2]);
    conf.setInt(KMeansBSP.MAX_ITERATIONS_KEY, iterations);
    int k = Integer.parseInt(args[3]);
    if (args.length == 7 && args[4].equals("-g")) {
      int count = Integer.parseInt(args[5]);
      if (k > count)
        throw new IllegalArgumentException("K can't be greater than n!");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.