Package org.apache.hama.bsp

Examples of org.apache.hama.bsp.ClusterStatus


    bsp.setOutputValueClass(DoubleWritable.class);
    bsp.setOutputFormat(TextOutputFormat.class);
    FileOutputFormat.setOutputPath(bsp, TMP_OUTPUT);

    BSPJobClient jobClient = new BSPJobClient(conf);
    ClusterStatus cluster = jobClient.getClusterStatus(true);

    if (args.length > 0) {
      bsp.setNumBspTask(Integer.parseInt(args[0]));
    } else {
      // Set to maximum
      bsp.setNumBspTask(cluster.getMaxTasks());
    }

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


    bsp.setInputPath(new Path(conf.get(inputMatrixPathString)));

    FileOutputFormat.setOutputPath(bsp, new Path(conf.get(outputPathString)));

    BSPJobClient jobClient = new BSPJobClient(conf);
    ClusterStatus cluster = jobClient.getClusterStatus(true);

    int requestedTasks = conf.getInt(requestedBspTasksString, -1);
    if (requestedTasks != -1) {
      bsp.setNumBspTask(requestedTasks);
    } else {
      bsp.setNumBspTask(cluster.getMaxTasks());
    }

    long startTime = System.currentTimeMillis();
    if (bsp.waitForCompletion(true)) {
      LOG.info("Job Finished in " + (System.currentTimeMillis() - startTime)
View Full Code Here

    bsp.setInputPath(new Path("/tmp/pagerank/real-tmp.seq"));
    bsp.setOutputPath(new Path(OUTPUT));
    BSPJobClient jobClient = new BSPJobClient(configuration);
    configuration.setInt(Constants.ZOOKEEPER_SESSION_TIMEOUT, 6000);
    configuration.set("hama.graph.self.ref", "true");
    ClusterStatus cluster = jobClient.getClusterStatus(false);
    assertEquals(this.numOfGroom, cluster.getGroomServers());
    LOG.info("Client finishes execution job.");
    bsp.setJobName("Pagerank");
    bsp.setVertexClass(PageRank.PageRankVertex.class);
    // set the defaults
    bsp.setMaxIteration(30);
View Full Code Here

  @Test
  public void test() throws Exception {
    HamaConfiguration conf = controller.getConfiguration();

    BSPJobClient jobClient = new BSPJobClient(conf);
    ClusterStatus cluster = jobClient.getClusterStatus(true);
    assertNotNull(cluster);
    assertTrue(cluster.getGroomServers() > 0);

    BSPJob bsp = new BSPJob(conf, PiEstimator.class);
    // Set the job name
    bsp.setJobName("Pi Estimation Example");
    bsp.setBspClass(MyEstimator.class);
    bsp.setNumBspTask(cluster.getGroomServers());

    for (String peerName : cluster.getActiveGroomNames().values()) {
      conf.set(masterTask, peerName);
      break;
    }

    if (bsp.waitForCompletion(true)) {
View Full Code Here

    running = true;
  }

  private static void waitForGroomServers(BSPJobClient client) throws IOException {
    while (true) {
      ClusterStatus clusterStatus = client.getClusterStatus(true);
      int grooms = clusterStatus.getGroomServers();
      if (grooms > 0) {
        LOG.info("{} groomservers reported in. Continuing.", grooms);
        break;
      }
      try {
View Full Code Here

    bsp.setOutputValueClass(DoubleWritable.class);
    bsp.setOutputFormat(TextOutputFormat.class);
    FileOutputFormat.setOutputPath(bsp, TMP_OUTPUT);

    BSPJobClient jobClient = new BSPJobClient(conf);
    ClusterStatus cluster = jobClient.getClusterStatus(true);

    if (args.length > 0) {
      bsp.setNumBspTask(Integer.parseInt(args[0]));
    } else {
      // Set to maximum
      bsp.setNumBspTask(cluster.getMaxTasks());
    }

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

          listArea[1] = uit.getArea(tplfile, "tasklist1");
          listArea[2] = uit.getArea(tplfile, "tasklist2");

          ServletContext ctx = getServletContext();
          BSPMaster tracker = (BSPMaster) ctx.getAttribute("bsp.master");
          ClusterStatus status = tracker.getClusterStatus(true);
          JobStatus jobStatus = tracker.getJobStatus(BSPJobID.forName(jobId));

          vars.put("hamaLogDir", hamaLogDir);
          vars.put("dirName", dirName);
          vars.put("targetUri", targetUri);
          vars.put("jobId", jobId);
          vars.put("jobStatus", jobStatus.getState().toString());
          vars.put("jobName", jobStatus.getName());

          out.println(uit.convert(listArea[0], vars));
          vars.clear();

          for (Entry<String, GroomServerStatus> entry : status
              .getActiveGroomServerStatus().entrySet()) {
            vars.put("jobId", jobId);
            vars.put("dirName", dirName);
            vars.put("serverName", entry.getKey());
            vars.put("hostName", entry.getValue().getGroomHostName());
View Full Code Here

    bsp.setOutputValueClass(DoubleWritable.class);
    bsp.setOutputFormat(TextOutputFormat.class);
    FileOutputFormat.setOutputPath(bsp, TMP_OUTPUT);

    BSPJobClient jobClient = new BSPJobClient(conf);
    ClusterStatus cluster = jobClient.getClusterStatus(true);

    if (args.length > 0) {
      bsp.setNumBspTask(Integer.parseInt(args[0]));
    } else {
      // Set to maximum
      bsp.setNumBspTask(cluster.getMaxTasks());
    }

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

    bsp.setOutputPath(new Path(OUTPUT));
    BSPJobClient jobClient = new BSPJobClient(configuration);
    configuration.setInt(Constants.ZOOKEEPER_SESSION_TIMEOUT, 6000);
    configuration.set("hama.graph.self.ref", "true");
    injectVerticesInfo();
    ClusterStatus cluster = jobClient.getClusterStatus(false);
    assertEquals(this.numOfGroom, cluster.getGroomServers());
    LOG.info("Client finishes execution job.");
    bsp.setJobName("Pagerank");
    bsp.setVertexClass(PageRank.PageRankVertex.class);
    // set the defaults
    bsp.setMaxIteration(30);
View Full Code Here

    GraphJob bsp = new GraphJob(configuration, PageRank.class);
    bsp.setInputPath(new Path(INPUT));
    bsp.setOutputPath(new Path(OUTPUT));
    BSPJobClient jobClient = new BSPJobClient(configuration);
    configuration.setInt(Constants.ZOOKEEPER_SESSION_TIMEOUT, 6000);
    ClusterStatus cluster = jobClient.getClusterStatus(false);
    assertEquals(this.numOfGroom, cluster.getGroomServers());
    bsp.setNumBspTask(2);
    LOG.info("Client finishes execution job.");
    bsp.setJobName("Pagerank");
    bsp.setVertexClass(PageRank.PageRankVertex.class);
    // set the defaults
View Full Code Here

TOP

Related Classes of org.apache.hama.bsp.ClusterStatus

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.