code: public Block[] getBlockReport(int namespaceId) throws IOException {
      ArrayList<Block> ret = new ArrayList<Block>();
      org.apache.hadoop.hdfs.server.datanode.NamespaceMap nm = volumeMap
          .getNamespaceMap(namespaceId);
      if (nm == null) {
        return new Block[0];
      }
      int n = nm.getNumBucket();
      for (int i = 0; i < n; i++) {
        BlockBucket bb = nm.getBucket(i);
        bb.getBlockReport(ret);
      }
      return ret.toArray(new Block[ret.size()]);
    }
docs: Get the list of finalized blocks from in-memory blockmap for a block pool.