Examples of HamaConfiguration


Examples of org.apache.hama.HamaConfiguration

    boolean submitJob = false;
    boolean getStatus = false;
    String submitJobFile = null;
    String jobid = null;

    HamaConfiguration conf = new HamaConfiguration(getConf());
    init(conf);

    if ("-list".equals(cmd)) {
      if (args.length != 1 && !(args.length == 2 && "all".equals(args[1]))) {
        displayUsage(cmd);
        return exitCode;
      }
      if (args.length == 2 && "all".equals(args[1])) {
        listAllJobs = true;
      } else {
        listJobs = true;
      }
    } else if ("-list-active-grooms".equals(cmd)) {
      if (args.length != 1) {
        displayUsage(cmd);
        return exitCode;
      }
      listActiveGrooms = true;
    } else if ("-submit".equals(cmd)) {
      if (args.length == 1) {
        displayUsage(cmd);
        return exitCode;
      }

      submitJob = true;
      submitJobFile = args[1];
    } else if ("-kill".equals(cmd)) {
      if (args.length == 1) {
        displayUsage(cmd);
        return exitCode;
      }
      killJob = true;
      jobid = args[1];

    } else if ("-status".equals(cmd)) {
      if (args.length != 2) {
        displayUsage(cmd);
        return exitCode;
      }
      jobid = args[1];
      getStatus = true;

      // TODO Later, below functions should be implemented
      // with the Fault Tolerant mechanism.
    } else if ("-list-attempt-ids".equals(cmd)) {
      System.out.println("This function is not implemented yet.");
      return exitCode;
    } else if ("-kill-task".equals(cmd)) {
      System.out.println("This function is not implemented yet.");
      return exitCode;
    } else if ("-fail-task".equals(cmd)) {
      System.out.println("This function is not implemented yet.");
      return exitCode;
    }

    BSPJobClient jc = new BSPJobClient(new HamaConfiguration());
    if (listJobs) {
      listJobs();
      exitCode = 0;
    } else if (listAllJobs) {
      listAllJobs();
      exitCode = 0;
    } else if (listActiveGrooms) {
      listActiveGrooms();
      exitCode = 0;
    } else if (submitJob) {
      HamaConfiguration tConf = new HamaConfiguration(new Path(submitJobFile));
      RunningJob job = jc.submitJob(new BSPJob(tConf));
      System.out.println("Created job " + job.getID().toString());
    } else if (killJob) {
      RunningJob job = jc.getJob(new BSPJobID().forName(jobid));
      if (job == null) {
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

      if (!rjob.localized) {
        Path localJarFile = defaultJobConf.getLocalPath(SUBDIR + "/"
            + task.getTaskID() + "/" + "job.jar");
        systemFS.copyToLocalFile(new Path(task.getJobFile()), localJobFile);

        HamaConfiguration conf = new HamaConfiguration();
        conf.addResource(localJobFile);
        jobConf = new BSPJob(conf, task.getJobID().toString());

        Path jarFile = new Path(jobConf.getJar());
        jobConf.setJar(localJarFile.toString());
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  public static class Child {

    public static void main(String[] args) throws Throwable {
      LOG.debug("Child starting");

      HamaConfiguration defaultConf = new HamaConfiguration();
      // report address
      String host = args[0];
      int port = Integer.parseInt(args[1]);
      InetSocketAddress address = new InetSocketAddress(host, port);
      TaskAttemptID taskid = TaskAttemptID.forName(args[2]);

      // //////////////////
      BSPPeerProtocol umbilical = (BSPPeerProtocol) RPC.getProxy(
          BSPPeerProtocol.class, BSPPeerProtocol.versionID, address,
          defaultConf);

      Task task = umbilical.getTask(taskid);

      defaultConf.addResource(new Path(task.getJobFile()));
      BSPJob job = new BSPJob(task.getJobID(), task.getJobFile());

      try {
        // use job-specified working directory
        FileSystem.get(job.getConf()).setWorkingDirectory(
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

   
    cluster = controller.launchCluster(clusterSpec);
    proxy = new HadoopProxy(clusterSpec, cluster);
    proxy.start();

    HamaConfiguration conf = getConfiguration();
    BSPJobClient client = new BSPJobClient(conf);
    waitForGroomServers(client);
   
    running = true;
  }
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

      }
    }
  }

  public HamaConfiguration getConfiguration() {
    HamaConfiguration conf = new HamaConfiguration();
    for (Entry<Object, Object> entry : cluster.getConfiguration().entrySet()) {
      conf.set(entry.getKey().toString(), entry.getValue().toString());
    }
    return conf;
  }
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

public class TestKMeansBSP extends TestCase {
  public static final String TMP_OUTPUT = "/tmp/clustering/";

  public void testRunJob() throws Exception {
    Configuration conf = new HamaConfiguration();
    FileSystem fs = FileSystem.get(conf);
    if (fs.exists(new Path(TMP_OUTPUT))) {
      fs.delete(new Path(TMP_OUTPUT), true);
    }
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  public void testBipartiteMatching() throws IOException, InterruptedException,
      ClassNotFoundException {
    deleteTempDirs();
    generateTestData();
    try {
      HamaConfiguration conf = new HamaConfiguration();
      GraphJob job = BipartiteMatching.createJob(new String[] { INPUT, OUTPUT,
          "30", "2" }, conf);
      job.setPartitioner(CustomTextPartitioner.class);

      long startTime = System.currentTimeMillis();
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  private static String baseDir;
  private static FileSystem fs;

  @Before
  public void prepare() throws IOException {
    conf = new HamaConfiguration();
    baseDir = "/tmp/spmv";
    fs = FileSystem.get(conf);
  }
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

   * Simple test. multiplying [1 0 6 0] [2] [38] [0 4 0 0] * [3] = [12] [0 2 3
   * 0] [6] [24] [3 0 0 5] [1] [11]
   */
  @Test
  public void simpleSpMVTest() {
    HamaConfiguration conf = new HamaConfiguration();
    String testDir = "/simple/";
    int size = 4;
    String matrixPath = baseDir + testDir + "inputMatrix";
    String vectorPath = baseDir + testDir + "inputVector";
    String outputPath = baseDir + testDir;
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

        layerSizeArraySb.append(' ');
      }
      conf.set("layerSizeArray", layerSizeArraySb.toString());
    }

    HamaConfiguration hamaConf = new HamaConfiguration(conf);

    BSPJob job = new BSPJob(hamaConf, SmallMLPTrainer.class);
    job.setJobName("Small scale MLP training");
    job.setJarByClass(SmallMLPTrainer.class);
    job.setBspClass(SmallMLPTrainer.class);
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.