Examples of addNameNode()


Examples of org.apache.hadoop.hdfs.MiniDFSCluster.addNameNode()

    Assert.assertNotNull(cluster);
    Assert.assertEquals("(2)Should be 1 namenodes", 1, cluster.getNumNameNodes());
   
    // add a node
    try {
      cluster.addNameNode(conf, 9929);
      Assert.fail("shouldn't be able to add another NN to non federated cluster");
    } catch (IOException e) {
      // correct
      Assert.assertTrue(e.getMessage().startsWith("cannot add namenode"));
      Assert.assertEquals("(3)Should be 1 namenodes", 1, cluster.getNumNameNodes());
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSCluster.addNameNode()

          numNameNodes(1).nameNodePort(nnPort1).build();

      DataNode dn = cluster.getDataNodes().get(0);
      assertEquals(1, dn.getAllBpOs().length);

      cluster.addNameNode(conf, nnPort2);
      assertEquals(2, dn.getAllBpOs().length);

      cluster.addNameNode(conf, nnPort3);
      assertEquals(3, dn.getAllBpOs().length);
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSCluster.addNameNode()

      assertEquals(1, dn.getAllBpOs().length);

      cluster.addNameNode(conf, nnPort2);
      assertEquals(2, dn.getAllBpOs().length);

      cluster.addNameNode(conf, nnPort3);
      assertEquals(3, dn.getAllBpOs().length);

      cluster.addNameNode(conf, nnPort4);

      BPOfferService[] bpoList = dn.getAllBpOs();
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSCluster.addNameNode()

      assertEquals(2, dn.getAllBpOs().length);

      cluster.addNameNode(conf, nnPort3);
      assertEquals(3, dn.getAllBpOs().length);

      cluster.addNameNode(conf, nnPort4);

      BPOfferService[] bpoList = dn.getAllBpOs();
      // Ensure a BPOfferService in the datanodes corresponds to
      // a namenode in the cluster
      for (int i = 0; i < 4; i++) {
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSCluster.addNameNode()

      BPOfferService [] bposs = dn.getAllBpOs();
      LOG.info("dn bpos len (should be 2):" + bposs.length);
      Assert.assertEquals("should've registered with two namenodes", bposs.length,2);
     
      // add another namenode
      cluster.addNameNode(conf, 9938);
      bposs = dn.getAllBpOs();
      LOG.info("dn bpos len (should be 3):" + bposs.length);
      Assert.assertEquals("should've registered with three namenodes", bposs.length,3);
     
      // change cluster id and another Namenode
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSCluster.addNameNode()

      LOG.info("dn bpos len (should be 3):" + bposs.length);
      Assert.assertEquals("should've registered with three namenodes", bposs.length,3);
     
      // change cluster id and another Namenode
      StartupOption.FORMAT.setClusterId("DifferentCID");
      cluster.addNameNode(conf, 9948);
      NameNode nn4 = cluster.getNameNode(3);
      assertNotNull("cannot create nn4", nn4);
     
      bposs = dn.getAllBpOs();
      LOG.info("dn bpos len (still should be 3):" + bposs.length);
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSCluster.addNameNode()

    nameNodePort(9928).build();
    Assert.assertNotNull(cluster);
    Assert.assertEquals("(1)Should be 2 namenodes", 2, cluster.getNumNameNodes());
   
    // add a node
    cluster.addNameNode(conf, 9929);
    Assert.assertEquals("(1)Should be 3 namenodes", 3, cluster.getNumNameNodes());
    cluster.shutdown();
       
    // 2. start with Federation flag set
    conf = new HdfsConfiguration();
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSCluster.addNameNode()

    nameNodePort(9928).build();
    Assert.assertNotNull(cluster);
    Assert.assertEquals("(2)Should be 1 namenodes", 1, cluster.getNumNameNodes());
   
    // add a node
    cluster.addNameNode(conf, 9929);  
    Assert.assertEquals("(2)Should be 2 namenodes", 2, cluster.getNumNameNodes());
    cluster.shutdown();

    // 3. start non-federated
    conf = new HdfsConfiguration();
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSCluster.addNameNode()

    Assert.assertNotNull(cluster);
    Assert.assertEquals("(2)Should be 1 namenodes", 1, cluster.getNumNameNodes());
   
    // add a node
    try {
      cluster.addNameNode(conf, 9929);
      Assert.fail("shouldn't be able to add another NN to non federated cluster");
    } catch (IOException e) {
      // correct
      Assert.assertTrue(e.getMessage().startsWith("cannot add namenode"));
      Assert.assertEquals("(3)Should be 1 namenodes", 1, cluster.getNumNameNodes());
View Full Code Here

Examples of org.apache.hadoop.hdfs.MiniDFSCluster.addNameNode()

      BPOfferService [] bposs = dn.getAllBpOs();
      LOG.info("dn bpos len (should be 2):" + bposs.length);
      Assert.assertEquals("should've registered with two namenodes", bposs.length,2);
     
      // add another namenode
      cluster.addNameNode(conf, 9938);
      Thread.sleep(500);// lets wait for the registration to happen
      bposs = dn.getAllBpOs();
      LOG.info("dn bpos len (should be 3):" + bposs.length);
      Assert.assertEquals("should've registered with three namenodes", bposs.length,3);
     
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.