Package org.apache.hama

Examples of org.apache.hama.HamaConfiguration


        && 1200 > input.computeGoalSize(10, 10000));

  }

  public void testSetInputPaths() throws IOException {
    HamaConfiguration conf = new HamaConfiguration();
    BSPJob job = new BSPJob(conf);

    String[] files = new String[2];
    files[0] = "hdfs://hadoop.uta.edu/user/hadoop/employee.txt";
    files[1] = "hdfs://hadoop.uta.edu/user/hadoop/department.txt";
View Full Code Here


    String msg = "Testing the spillage of spilling buffer";
    Text text = new Text(msg);
    TaskAttemptID id = new TaskAttemptID(new TaskID("123", 1, 2), 0);
    SpillingQueue<Text> queue = new SpillingQueue<Text>();
    Configuration conf = new HamaConfiguration();

    String fileName = System.getProperty("java.io.tmpdir") + File.separatorChar
        + new BigInteger(128, new SecureRandom()).toString(32);
    File file = new File(fileName);
    conf.set(SpillingQueue.SPILLBUFFER_FILENAME, fileName);
    conf.setClass(SpillingQueue.SPILLBUFFER_MSGCLASS, Text.class,
        Writable.class);
    queue.init(conf, id);
    queue.prepareWrite();
    for (int i = 0; i < 1000; ++i) {
      queue.add(text);
View Full Code Here

    String msg = "Testing the spillage of spilling buffer";
    Text text = new Text(msg);
    TaskAttemptID id = new TaskAttemptID(new TaskID("123", 1, 2), 0);
    SpillingQueue<Text> queue = new SpillingQueue<Text>();
    Configuration conf = new HamaConfiguration();

    String fileName = System.getProperty("java.io.tmpdir") + File.separatorChar
        + new BigInteger(128, new SecureRandom()).toString(32);
    File file = new File(fileName);
    conf.set(SpillingQueue.SPILLBUFFER_FILENAME, fileName);
    queue.init(conf, id);
    queue.prepareWrite();
    for (int i = 0; i < 1000; ++i) {
      queue.add(text);
    }
View Full Code Here

   * 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

  }

  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

public class TestCompositeInputFormat extends HamaCluster {
  protected HamaConfiguration configuration;

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

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

    HamaConfiguration conf = new HamaConfiguration();
    BSPJob job = new BSPJob(conf);

    FileInputFormat.setInputPaths(job, "/tmp/a.dat,/tmp/b.dat");

    job.setInputFormat(CompositeInputFormat.class);
View Full Code Here

    assertTrue(bsp.waitForCompletion(true));
  }

  public BSPJob getNewJobConf() throws Exception {
    Configuration conf = new Configuration();
    BSPJob bsp = new BSPJob(new HamaConfiguration(conf));
    bsp.setJobName("Test persistent behaviour");
    bsp.setBspClass(persistentMsgBSP.class);
    bsp.setNumBspTask(2);
    bsp.setInputFormat(NullInputFormat.class);
    bsp.setOutputFormat(NullOutputFormat.class);
View Full Code Here

  // these variables are preventing from rebooting the whole stuff again since
  // setup and teardown are called per method.

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

public class TestLocalRunner extends TestCase {

  public void testOutputJob() throws Exception {
    Configuration conf = new Configuration();
    conf.set("bsp.local.dir", "/tmp/hama-test");
    BSPJob bsp = new BSPJob(new HamaConfiguration(conf));
    bsp.setJobName("Test Serialize Printing with Output");

    bsp.setBspClass(org.apache.hama.examples.ClassSerializePrinting.class);
    bsp.setOutputFormat(SequenceFileOutputFormat.class);
    bsp.setOutputKeyClass(IntWritable.class);
View Full Code Here

TOP

Related Classes of org.apache.hama.HamaConfiguration

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.