Examples of NumberReplicas


Examples of org.apache.hadoop.hdfs.server.namenode.FSNamesystem.NumberReplicas

      // bring up the datanode
      cluster.restartDataNode(dnprop);
     
      // Wait for block report
      LOG.info("wait for its block report to come in");
      NumberReplicas num;
      FileStatus stat = dfs.getFileStatus(new Path(filePath));
      LocatedBlocks blocks = dfs.getClient().
          getLocatedBlocks(filePath, 0, stat.getLen());
      long startTime = System.currentTimeMillis();
      do {
        Thread.sleep(1000);
        int totalCount = 0;
        namesystem.readLock();
        try {
          for (LocatedBlock block : blocks.getLocatedBlocks()) {
            num = namesystem.countNodes(block.getBlock());
            totalCount += num.liveReplicas();
          }
          if (totalCount == rsCodec.numDataBlocks) {
            break;
          } else {
            LOG.info("wait for block report, received total replicas: " + totalCount);
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.