Examples of waitActive()


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

      fs.close();
      cluster.shutdown();
     
      // now bring up just the NameNode.
      cluster = new MiniDFSCluster(conf, 0, false, null);
      cluster.waitActive();
      fs = (DistributedFileSystem)cluster.getFileSystem();
     
      LOG.info("Restarted cluster with just the NameNode");
     
      assertTrue("No datanode is started. Should be in SafeMode",
View Full Code Here

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

      // manually set safemode.
      fs.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
     
      // now bring up the datanode and wait for it to be active.
      cluster.startDataNodes(conf, 1, true, null, null);
      cluster.waitActive();
     
      LOG.info("Datanode is started.");

      // wait longer than dfs.safemode.extension
      try {
View Full Code Here

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

      conf.set("dfs.safemode.extension", "0");
      conf.set("dfs.safemode.min.datanodes", "1");

      // bring up a cluster with no datanodes
      cluster = new MiniDFSCluster(conf, 0, false, null);
      cluster.waitActive();
      fs = (DistributedFileSystem)cluster.getFileSystem();

      assertTrue("No datanode started, but we require one - safemode expected",
                 fs.setSafeMode(SafeModeAction.SAFEMODE_GET));
View Full Code Here

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

          "127.0.0.1,localhost");
      dfsConf.set("hadoop.proxyuser." + testUser + ".hosts",
          "127.0.0.1,localhost");
      dfsConf.set("hadoop.security.authentication", "simple");
      cluster = new MiniDFSCluster(dfsConf, 2, true, null);
      cluster.waitActive();

      final FileSystem localfs = FileSystem.get(LOCAL_FS, dfsConf);
      final FileSystem hdfs = cluster.getFileSystem();
      final Configuration proxyConf = new Configuration(false);
      proxyConf.set("hdfsproxy.dfs.namenode.address", hdfs.getUri().getHost() + ":"
View Full Code Here

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

   */
  @Test
  public void testSaveNamespaceWithRenamedLease() throws Exception {
    MiniDFSCluster cluster = new MiniDFSCluster.Builder(new Configuration())
        .numDataNodes(1).build();
    cluster.waitActive();
    DistributedFileSystem fs = (DistributedFileSystem) cluster.getFileSystem();
    OutputStream out = null;
    try {
      fs.mkdirs(new Path("/test-target"));
      out = fs.create(new Path("/test-source/foo")); // don't close
View Full Code Here

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

 
  @Test (timeout=30000)
  public void testSaveNamespaceWithDanglingLease() throws Exception {
    MiniDFSCluster cluster = new MiniDFSCluster.Builder(new Configuration())
        .numDataNodes(1).build();
    cluster.waitActive();
    DistributedFileSystem fs = cluster.getFileSystem();
    try {
      cluster.getNamesystem().leaseManager.addLease("me", "/non-existent");     
      fs.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
      cluster.getNameNodeRpc().saveNamespace();
View Full Code Here

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

    Configuration conf = new Configuration();
    MiniDFSCluster cluster = null;

    try {
      cluster = new MiniDFSCluster.Builder(conf).build();
      cluster.waitActive();

      FSNamesystem fsn = cluster.getNameNode().namesystem;

      MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
      ObjectName mxbeanName = new ObjectName(
View Full Code Here

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

    MiniDFSCluster cluster = null;
    FSNamesystem fsn = null;

    try {
      cluster = new MiniDFSCluster.Builder(conf).build();
      cluster.waitActive();

      fsn = cluster.getNameNode().namesystem;
      fsn.writeLock();

      MBeanClient client = new MBeanClient();
View Full Code Here

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

      conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 10000L);
      cluster = new MiniDFSCluster.Builder(conf).numDataNodes(4).build();
      String topDir = "/srcdat";
      String randomString = "HADOOP  ";
      fs = cluster.getFileSystem();
      cluster.waitActive();
      util.createFiles(fs, topDir);
      util.waitReplication(fs, topDir, (short)3);
      String outStr = runFsck(conf, 0, true, "/");
      assertTrue(outStr.contains(NamenodeFsck.HEALTHY_STATUS));
      // Open a file for writing and do not close for now
View Full Code Here

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

    short factor = 1;

    MiniDFSCluster cluster = null;
    try {
    cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).build();
    cluster.waitActive();
    fs = cluster.getFileSystem();
    Path file1 = new Path("/testCorruptBlock");
    DFSTestUtil.createFile(fs, file1, 1024, factor, 0);
    // Wait until file replication has completed
    DFSTestUtil.waitReplication(fs, file1, factor);
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.