Examples of RaidBlockInfo


Examples of org.apache.hadoop.hdfs.server.namenode.INodeRaidStorage.RaidBlockInfo

    int numStripes = getNumStripes(blocks.length);
    for (int i = 0; i < numStripes; i++) {
      System.arraycopy(parityBlocks, pPos, newList, pos, numParityBlocks);
      for (int j = pos; j < pos + numParityBlocks; j++) {
        blocksMap.updateINode(newList[j],
            new RaidBlockInfo(newList[j], parityReplication, j), inode,
            parityReplication, true);
      }
      pPos += numParityBlocks;
      pos += numParityBlocks;
      for (int j = 0; j < numDataBlocks && sPos < blocks.length;
          j++, pos++, sPos++) {
        newList[pos] = blocks[sPos];
        if (checksums != null) {
          if (blocks[sPos].getChecksum() != BlockInfo.NO_BLOCK_CHECKSUM
              && blocks[sPos].getChecksum() != checksums[sPos]) {
            throw new IOException("Checksum mismatch for the " + sPos +
                "th source blocks. New=" + checksums[sPos] +
                ", Existing=" + blocks[sPos].getChecksum());
          }
          blocks[sPos].setChecksum(checksums[sPos]);
        }
        blocksMap.updateINode(newList[pos], new RaidBlockInfo(newList[pos],
            replication, pos), inode, replication, true);
      }
    }
    return newList;
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.INodeRaidStorage.RaidBlockInfo

            break;
          }
        }
      }
      if (!hasParity || forceAdd) {
        raidEncodingTasks.add(new RaidBlockInfo(blocks[i], parityReplication, i));
        result = false;
      }
    }
    return result;
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.INodeRaidStorage.RaidBlockInfo

     */
    boolean add(BlockInfo blockInfo) {
      INodeFile fileINode = blockInfo.getINode();
      try {
        int blockIndex = getBlockIndex(blockInfo);
        RaidBlockInfo firstBlock = fileINode.getFirstBlockInStripe(blockInfo, blockIndex);
        HashSet<Integer> missingBlkIdxs = null;
        int i = 0;
        for (; i < maxLevel; i++) {
          HashMap<RaidBlockInfo, HashSet<Integer>> queue = priorityQueues.get(i);
          if (queue.containsKey(firstBlock)) {
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.INodeRaidStorage.RaidBlockInfo

     */
    boolean remove(BlockInfo blockInfo) {
      INodeFile fileINode = blockInfo.getINode();
      try {
        int blockIndex = getBlockIndex(blockInfo);
        RaidBlockInfo firstBlock = fileINode.getFirstBlockInStripe(blockInfo, blockIndex);
        HashSet<Integer> missingBlkIdxs = null;
        int i = 0;
        for (; i < maxLevel; i++) {
          HashMap<RaidBlockInfo, HashSet<Integer>> queue = priorityQueues.get(i);
          if (queue.containsKey(firstBlock)) {
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.INodeRaidStorage.RaidBlockInfo

      if ((-9 <= imgVersion && numBlocks > 0) ||
          (imgVersion < -9 && numBlocks >= 0)) {
        blocks = new BlockInfo[numBlocks];
        for (int j = 0; j < numBlocks; j++) {
          if (inodeType == INode.INodeType.RAIDED_INODE.type) {
            blocks[j] = new RaidBlockInfo(replication, j);
          } else {
            blocks[j] = new BlockInfo();
            blocks[j].setReplication(replication);
          }
          if (-14 < imgVersion) {
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.INodeRaidStorage.RaidBlockInfo

    // already in the map - just allocate and insert
    // for hardlink files, and outside of loading, we need to always check
    BlockInfo info = checkExistence ? blocks.get(b) : null;
    if (info == null) {
      if (b instanceof RaidBlockInfo) {
        info = new RaidBlockInfo(b, replication, ((RaidBlockInfo)b).getIndex());
      } else {
        info = new BlockInfo(b, replication);
      }
      blocks.put(info);
    }
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.