Package org.apache.hadoop.hdfs

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


          Thread.sleep(1000);
        } catch (InterruptedException ignored) {}
      }
     
      // restart the datanode so the corrupt replica will be detected
      cluster.restartDataNode(dnProps);
      DFSTestUtil.waitReplication(fs, fileName, (short)2);
     
      String blockPoolId = cluster.getNamesystem().getBlockPoolId();
      final DatanodeID corruptDataNode =
        DataNodeTestUtils.getDNRegistrationForBP(
View Full Code Here


      assertEquals(2, namesystem.blockManager.countNodes(block)
          .liveReplicas());
      assertEquals(1, namesystem.blockManager.countNodes(block)
          .corruptReplicas());

      cluster.restartDataNode(dnPropsFourth);

      DFSTestUtil.waitReplication(fs, fileName, (short) 3);

      assertEquals(3, namesystem.blockManager.countNodes(block)
          .liveReplicas());
View Full Code Here

      }
      // the block will be replicated
      DFSTestUtil.waitReplication(fs, FILE_PATH, REPLICATION_FACTOR);

      // restart the first datanode
      cluster.restartDataNode(dnprop);
      cluster.waitActive();
     
      // check if excessive replica is detected
      NumberReplicas num = null;
      do {
View Full Code Here

        num = namesystem.blockManager.countNodes(block);
        namesystem.writeUnlock();
      } while (num.liveReplicas() != REPLICATION_FACTOR);
     
      // restart the first datanode
      cluster.restartDataNode(dnprop);
      cluster.waitActive();
     
      // check if excessive replica is detected
      do {
        namesystem.writeLock();
View Full Code Here

      int dnToCorrupt = DFSTestUtil.firstDnWithBlock(cluster, b);
      assertTrue(cluster.corruptReplica(b.getBlockName(), dnToCorrupt));

      // Restart the datanode so blocks are re-scanned, and the corrupt
      // block is detected.
      cluster.restartDataNode(dnToCorrupt);

      // Wait for the namenode to notice the corrupt replica
      DFSTestUtil.waitCorruptReplicas(fs, ns, filePath, b, 1);

      // The rack policy is still respected
View Full Code Here

          Thread.sleep(1000);
        } catch (InterruptedException ignored) {}
      }
     
      // restart the datanode so the corrupt replica will be detected
      cluster.restartDataNode(dnProps);
      DFSTestUtil.waitReplication(fs, fileName, (short)2);
     
      final DatanodeID corruptDataNode =
        cluster.getDataNodes().get(2).dnRegistration;
      final FSNamesystem namesystem = cluster.getNamesystem();
View Full Code Here

      DataNode dn = cluster.getDataNodes().get(index);
      Thread.sleep(3000);
      dn.scheduleNSBlockReceivedAndDeleted(0);
      Thread.sleep(3000);
      LOG.info("Start a new node");
      cluster.restartDataNode(dnprop);
      cluster.waitActive(false);
      // The block should be replicated
      LOG.info("wait for the block to replicate");
      NumberReplicas num;
      long startTime = System.currentTimeMillis();
View Full Code Here

      DataNode dn = cluster.getDataNodes().get(index);
      Thread.sleep(3000);
      dn.scheduleNSBlockReceivedAndDeleted(0);
      Thread.sleep(3000);
      LOG.info("Start a new node");
      cluster.restartDataNode(dnprop);
      cluster.waitActive(false);
      // The block should be replicated
      LOG.info("wait for the block to replicate");
      NumberReplicas num;
      long startTime = System.currentTimeMillis();
View Full Code Here

      LOG.info("Decommission the datanode " + dnprop);
      addToExcludeFile(namesystem.getConf(), datanodes);
      namesystem.refreshNodes(namesystem.getConf());     
     
      // bring up the datanode
      cluster.restartDataNode(dnprop);

      // Wait for block report
      LOG.info("wait for its block report to come in");
      NumberReplicas num;
      long startTime = System.currentTimeMillis();
View Full Code Here

      // the block will be replicated
      DFSTestUtil.waitReplication(fs, FILE_PATH, REPLICATION_FACTOR);

      LOG.info("Restarting first datanode");
      // restart the first datanode
      cluster.restartDataNode(dnprop);
      cluster.waitActive(false);

      LOG.info("Waiting for excess replicas to be detected");
     
      // check if excessive replica is detected
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.