Package org.apache.hadoop.hdfs

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


      // Occasionally the BlockPoolSliceScanner can run before we have removed
      // the blocks. Restart the Datanode to trigger the scanner into running
      // once more.
      LOG.info("Restarting Datanode to trigger BlockPoolSliceScanner");
      cluster.restartDataNodes();
      cluster.waitActive();

      badFiles =
        namenode.getNamesystem().listCorruptFileBlocks("/srcdat2", null);
       
View Full Code Here


       * namenode. This test should run while namenode is down (to make sure no
       * new tokens can be fetched from namenode).
       */

      // restart datanodes on the same ports that they currently use
      assertTrue(cluster.restartDataNodes(true));
      cluster.waitActive();
      assertEquals(numDataNodes, cluster.getDataNodes().size());
      cluster.shutdownNameNode(0);

      // confirm tokens cached in in1 are still valid
View Full Code Here

       * setup of this test depends on the previous test.
       */

      // restore the cluster and restart the datanodes for test
      cluster.restartNameNode(0);
      assertTrue(cluster.restartDataNodes(true));
      cluster.waitActive();
      assertEquals(numDataNodes, cluster.getDataNodes().size());

      // shutdown namenode so that DFSClient can't get new tokens from namenode
      cluster.shutdownNameNode(0);
View Full Code Here

       * testing that when datanodes are restarted on different ports, DFSClient
       * is able to re-fetch tokens transparently to connect to them
       */

      // restart datanodes on newly assigned ports
      assertTrue(cluster.restartDataNodes(false));
      cluster.waitActive();
      assertEquals(numDataNodes, cluster.getDataNodes().size());
      // verify blockSeekTo() is able to re-fetch token transparently
      in1.seek(0);
      assertTrue(checkFile1(in1));
View Full Code Here

          (short) 3, 0);

      // Remove the datanode, enter safemode and restart it.
      ns.removeDatanode(dns.get(0));
      ns.setSafeMode(SafeModeAction.SAFEMODE_ENTER);
      cluster.restartDataNodes();

      // Wait for a block report.
      long start = System.currentTimeMillis();
      while (System.currentTimeMillis() - start < 10000
          && ns.getSafeBlocks() != 1) {
View Full Code Here

            .getDatanode(dinfo[i]);
        assertEquals(0, desc.numBlocks());
      }

      h.clearEvents();
      cluster.restartDataNodes();
      long start = System.currentTimeMillis();
      while (!h.processedEvents
          .containsKey(InjectionEvent.FSNAMESYSTEM_BLOCKREPORT_COMPLETED)
          && !(numNodes == h.processedEvents
              .get(InjectionEvent.FSNAMESYSTEM_BLOCKREPORT_COMPLETED))
View Full Code Here

          TestCase.fail("block CRC file is not flushed.");
        } else {
          Thread.sleep(100);
        }
      }
      cluster.restartDataNodes();
      cluster.waitActive();
      // Verify that block CRC is recovered.
      data = getFSDS(cluster);
      nm = data.volumeMap.getNamespaceMap(data.volumeMap.getNamespaceList()[0]);
      for (int i = 0; i < nm.getNumBucket(); i++) {
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.