Examples of StorageBlockReport


Examples of org.apache.hadoop.hdfs.server.protocol.StorageBlockReport

      // register datanode
      dnRegistration = nameNodeProto.registerDatanode(dnRegistration);
      //first block reports
      storage = new DatanodeStorage(dnRegistration.getStorageID());
      final StorageBlockReport[] reports = {
          new StorageBlockReport(storage,
              new BlockListAsLongs(null, null).getBlockListAsLongs())
      };
      nameNodeProto.blockReport(dnRegistration,
          nameNode.getNamesystem().getBlockPoolId(), reports);
    }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.StorageBlockReport

    long executeOp(int daemonId, int inputIdx, String ignore) throws IOException {
      assert daemonId < numThreads : "Wrong daemonId.";
      TinyDatanode dn = datanodes[daemonId];
      long start = System.currentTimeMillis();
      StorageBlockReport[] report = { new StorageBlockReport(
          dn.storage, dn.getBlockReportList()) };
      nameNodeProto.blockReport(dn.dnRegistration, nameNode.getNamesystem()
          .getBlockPoolId(), report);
      long end = System.currentTimeMillis();
      return end-start;
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.StorageBlockReport

      List<Long> blockIds = s.getBlocksList();
      long[] blocks = new long[blockIds.size()];
      for (int i = 0; i < blockIds.size(); i++) {
        blocks[i] = blockIds.get(i);
      }
      report[index++] = new StorageBlockReport(PBHelper.convert(s.getStorage()),
          blocks);
    }
    try {
      cmd = impl.blockReport(PBHelper.convert(request.getRegistration()),
          request.getBlockPoolId(), report);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.StorageBlockReport

      List<Long> blockIds = s.getBlocksList();
      long[] blocks = new long[blockIds.size()];
      for (int i = 0; i < blockIds.size(); i++) {
        blocks[i] = blockIds.get(i);
      }
      report[index++] = new StorageBlockReport(PBHelper.convert(s.getStorage()),
          blocks);
    }
    try {
      cmd = impl.blockReport(PBHelper.convert(request.getRegistration()),
          request.getBlockPoolId(), report);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.StorageBlockReport

      // register datanode
      dnRegistration = nameNodeProto.registerDatanode(dnRegistration);
      //first block reports
      storage = new DatanodeStorage(dnRegistration.getStorageID());
      final StorageBlockReport[] reports = {
          new StorageBlockReport(storage,
              new BlockListAsLongs(null, null).getBlockListAsLongs())
      };
      nameNodeProto.blockReport(dnRegistration,
          nameNode.getNamesystem().getBlockPoolId(), reports);
    }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.StorageBlockReport

    @Override
    long executeOp(int daemonId, int inputIdx, String ignore) throws IOException {
      assert daemonId < numThreads : "Wrong daemonId.";
      TinyDatanode dn = datanodes[daemonId];
      long start = Time.now();
      StorageBlockReport[] report = { new StorageBlockReport(
          dn.storage, dn.getBlockReportList()) };
      nameNodeProto.blockReport(dn.dnRegistration, nameNode.getNamesystem()
          .getBlockPoolId(), report);
      long end = Time.now();
      return end-start;
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.StorageBlockReport

      BlockListAsLongs bReport = dn.getFSDataset().getBlockReport(
          bpos.getBlockPoolId());

      // Send block report
      long brSendStartTime = now();
      StorageBlockReport[] report = { new StorageBlockReport(
          new DatanodeStorage(bpRegistration.getStorageID()),
          bReport.getBlockListAsLongs()) };
      cmd = bpNamenode.blockReport(bpRegistration, bpos.getBlockPoolId(), report);

      // Log the block report processing stats from Datanode perspective
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.StorageBlockReport

    } catch (IOException ex) {
      // Expected
    }

    // Ensure blockReport from dead datanode is rejected with IOException
    StorageBlockReport[] report = { new StorageBlockReport(
        new DatanodeStorage(reg.getStorageID()),
        new long[] { 0L, 0L, 0L }) };
    try {
      dnp.blockReport(reg, poolId, report);
      fail("Expected IOException is not thrown");
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.StorageBlockReport

    // Generate a fake block report from one of the DataNodes, such
    // that it reports one copy of each block on either storage.
    DataNode dn = cluster.getDataNodes().get(0);
    DatanodeRegistration dnReg = dn.getDNRegistrationForBP(bpid);
    StorageBlockReport reports[] =
        new StorageBlockReport[MiniDFSCluster.DIRS_PER_DATANODE];

    ArrayList<Block> blocks = new ArrayList<Block>();

    for (LocatedBlock locatedBlock : locatedBlocks.getLocatedBlocks()) {
      blocks.add(locatedBlock.getBlock().getLocalBlock());
    }

    for (int i = 0; i < MiniDFSCluster.DIRS_PER_DATANODE; ++i) {
      BlockListAsLongs bll = new BlockListAsLongs(blocks, null);
      FsVolumeSpi v = dn.getFSDataset().getVolumes().get(i);
      DatanodeStorage dns = new DatanodeStorage(v.getStorageID());
      reports[i] = new StorageBlockReport(dns, bll.getBlockListAsLongs());
    }

    // Should not assert!
    cluster.getNameNodeRpc().blockReport(dnReg, bpid, reports);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.StorageBlockReport

          break;
        }
      }

      reports[reportIndex++] =
          new StorageBlockReport(dnStorage, blockList.getBlockListAsLongs());
    }

    return reports;
  }
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.