Examples of HamaConfiguration


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);
    // Set the job name
    bsp.setJobName("Pi Estimation Example");
    bsp.setBspClass(MyEstimator.class);
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

      System.out.println("Usage: <sizeOfMsg> <nCommunications> <nSupersteps>");
      System.exit(-1);
    }

    // BSP job configuration
    HamaConfiguration conf = new HamaConfiguration();

    conf.setInt(SIZEOFMSG, Integer.parseInt(args[0]));
    conf.setInt(N_COMMUNICATIONS, Integer.parseInt(args[1]));
    conf.setInt(N_SUPERSTEPS, Integer.parseInt(args[2]));

    BSPJob bsp = new BSPJob(conf, RandBench.class);
    // Set the job name
    bsp.setJobName("Random Communication Benchmark");
    bsp.setBspClass(RandBSP.class);
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

   * starting.
   *
   * @param baseConf Hadoop Configuration.
   */
  public static void run(Configuration baseConf) {
    Configuration conf = new HamaConfiguration(baseConf);
    if (BSPMaster.getAddress(conf) == null) {
      System.out.println(BSPMaster.localModeMessage);
      LOG.info(BSPMaster.localModeMessage);
      System.exit(0);
    }
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  }

  private static void writeMyID(Properties properties) throws IOException {
    long myId = -1;

    Configuration conf = new HamaConfiguration();
    String myAddress = DNS.getDefaultHost(
        conf.get("hama.zookeeper.dns.interface", "default"),
        conf.get("hama.zookeeper.dns.nameserver", "default"));

    List<String> ips = new ArrayList<String>();

    // Add what could be the best (configured) match
    ips.add(myAddress.contains(".") ? myAddress : StringUtils
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);
    // Set the job name
    bsp.setJobName("Pi Estimation Example");
    bsp.setBspClass(MyEstimator.class);

    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.getGroomServers());
    }

    // Choose one as a master
    for (String peerName : cluster.getActiveGroomNames().values()) {
      conf.set(MASTER_TASK, peerName);
      break;
    }

    FileSystem fileSys = FileSystem.get(conf);
    initTempDir(fileSys);
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

      System.out.println("Usage: <sizeOfMsg> <nCommunications> <nSupersteps>");
      System.exit(-1);
    }

    // BSP job configuration
    HamaConfiguration conf = new HamaConfiguration();

    conf.setInt(SIZEOFMSG, Integer.parseInt(args[0]));
    conf.setInt(N_COMMUNICATIONS, Integer.parseInt(args[1]));
    conf.setInt(N_SUPERSTEPS, Integer.parseInt(args[2]));

    BSPJob bsp = new BSPJob(conf, RandBench.class);
    // Set the job name
    bsp.setJobName("Random Communication Benchmark");
    bsp.setBspClass(RandBSP.class);
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

        LOG.error("Fail to check BSP Master's state.", ie);
        Thread.currentThread().interrupt();
      }
    }
    for(int i=0; i < this.grooms; i++){
      HamaConfiguration c = new HamaConfiguration(this.configuration);
      randomPort(c);
      GroomServerRunner gsr = new GroomServerRunner(c);
      groomServerList.add(gsr);
      scheduler.schedule(gsr, 0, SECONDS);
      cnt = 0;
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  /**
   * Parse ZooKeeper configuration from Hama XML config and run a QuorumPeer.
   * @param baseConf Hadoop Configuration.
   */
  public static void run(Configuration baseConf) {
    Configuration conf = new HamaConfiguration(baseConf);
    try {
      Properties zkProperties = makeZKProps(conf);
      writeMyID(zkProperties);
      QuorumPeerConfig zkConfig = new QuorumPeerConfig();
      zkConfig.parseProperties(zkProperties);
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  }

  private static void writeMyID(Properties properties) throws IOException {
    long myId = -1;

    Configuration conf = new HamaConfiguration();
    String myAddress = DNS.getDefaultHost(
        conf.get("hama.zookeeper.dns.interface","default"),
        conf.get("hama.zookeeper.dns.nameserver","default"));

    List<String> ips = new ArrayList<String>();

    // Add what could be the best (configured) match
    ips.add(myAddress.contains(".") ?
View Full Code Here

Examples of org.apache.hama.HamaConfiguration

  private JobState state = JobState.DEFINE;
  private BSPJobClient jobClient;
  private RunningJob info;

  public BSPJob() throws IOException {
    this(new HamaConfiguration());
  }
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.