Examples of HamaConfiguration


Examples of org.apache.hama.HamaConfiguration

  public static final Log LOG = LogFactory.getLog(TestPatternFilter.class);

  private HamaConfiguration conf;

  public void setUp() throws Exception{
    this.conf = new HamaConfiguration();
  }
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  private MetricsSystem metricsSystem;
  private HamaConfiguration conf;

  public void setUp() throws Exception{
    this.conf = new HamaConfiguration();
    this.conf.set("bsp.metrics.conf_files", "hama-metrics-msys.properties");
    this.metricsSystem = MetricsFactory.createMetricsSystem("test", conf);
    assertNotNull("Ensure metrics system is not null.", this.metricsSystem);
    this.metricsSystem.start();
  }
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  static final String checkpointedDir = "checkpoint/job_201110302255_0001/0/";

  @SuppressWarnings("unchecked")
  public void testCheckpoint() throws Exception {
    Configuration config = new HamaConfiguration();
    FileSystem dfs = FileSystem.get(config);

    BSPPeerImpl bspTask = new BSPPeerImpl(config, dfs);
    assertNotNull("BSPPeerImpl should not be null.", bspTask);
    if(dfs.mkdirs(new Path("checkpoint"))) {
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  static Path OUTPUT_PATH = new Path(TMP_OUTPUT + "serialout");

  private HamaConfiguration configuration;

  public TestBSPMasterGroomServer() {
    configuration = new HamaConfiguration();
    configuration.set("bsp.master.address", "localhost");
    assertEquals("Make sure master addr is set to localhost:", "localhost",
        configuration.get("bsp.master.address"));
    configuration.set("bsp.local.dir", "/tmp/hama-test");
    configuration.set(Constants.ZOOKEEPER_QUORUM, "localhost");
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

        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 = null;
        if (jobConf.getJar() != null) {
          jarFile = new Path(jobConf.getJar());
        } else {
          LOG.warn("No jar file for job " + task.getJobID()
              + " has been defined!");
        }
        jobConf.setJar(localJarFile.toString());

        if (jarFile != null) {
          systemFS.copyToLocalFile(jarFile, localJarFile);

          // also unjar the job.jar files in workdir
          File workDir = new File(
              new File(localJobFile.toString()).getParent(), "work");
          if (!workDir.mkdirs()) {
            if (!workDir.isDirectory()) {
              throw new IOException("Mkdirs failed to create "
                  + workDir.toString());
            }
          }
          RunJar.unJar(new File(localJarFile.toString()), workDir);
        }
        rjob.localized = true;
      } else {
        HamaConfiguration conf = new HamaConfiguration();
        conf.addResource(rjob.getJobFile());
        jobConf = new BSPJob(conf, rjob.getJobId().toString());
      }
    }

    launchTaskForJob(tip, jobConf);
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

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

      final 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);

      final BSPTask task = (BSPTask) umbilical.getTask(taskid);
      int peerPort = umbilical.getAssignedPortNum(taskid);

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

      defaultConf.set(Constants.PEER_HOST, args[3]);
      if (null != args && 5 == args.length) {
        defaultConf.setInt("bsp.checkpoint.port", Integer.parseInt(args[4]));
      }
      defaultConf.setInt(Constants.PEER_PORT, peerPort);

      try {
        // use job-specified working directory
        FileSystem.get(job.getConf()).setWorkingDirectory(
            job.getWorkingDirectory());
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, CombineExample.class);
    // Set the job name
    bsp.setJobName("Combine Example");
    bsp.setBspClass(MyBSP.class);
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

    if (args.length == 0) {
      printUsage();
      System.exit(-1);
    }

    HamaConfiguration conf = new HamaConfiguration(new Configuration());
    BSPJob job = new BSPJob(conf, PageRank.class);
    job.setJobName("Pagerank");

    job.setInputPath(new Path(args[0]));
    job.setOutputPath(new Path(args[1]));

    conf.set("damping.factor", (args.length > 2) ? args[2] : "0.85");
    conf.set("epsilon.error", (args.length > 3) ? args[3] : "0.000001");
    if (args.length == 5) {
      job.setNumBspTask(Integer.parseInt(args[4]));
    }

    // leave the iterations on default
    conf.set("max.iterations", "0");

    job.setInputFormat(SequenceFileInputFormat.class);
    job.setPartitioner(HashPartitioner.class);
    job.setOutputFormat(SequenceFileOutputFormat.class);
    job.setOutputKeyClass(Text.class);
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

      printUsage();
      System.exit(-1);
    }

    // BSP job configuration
    HamaConfiguration conf = new HamaConfiguration();
    BSPJob bsp = new BSPJob(conf, ShortestPaths.class);
    // Set the job name
    bsp.setJobName("Single Source Shortest Path");

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

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

Examples of org.apache.hama.HamaConfiguration

    this.conf = conf;
    this.jobId = jobId;
  }

  public BSPJobContext(Path config, BSPJobID jobId) throws IOException {
    this.conf = new HamaConfiguration();
    this.jobId = jobId;
    this.conf.addResource(config);
  }
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.