当前位置: 首页>>代码示例>>Java>>正文


Java ECBlockGroup.getParityBlocks方法代码示例

本文整理汇总了Java中org.apache.hadoop.io.erasurecode.ECBlockGroup.getParityBlocks方法的典型用法代码示例。如果您正苦于以下问题:Java ECBlockGroup.getParityBlocks方法的具体用法?Java ECBlockGroup.getParityBlocks怎么用?Java ECBlockGroup.getParityBlocks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.io.erasurecode.ECBlockGroup的用法示例。


在下文中一共展示了ECBlockGroup.getParityBlocks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOutputBlocks

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入方法依赖的package包/类
/**
 * Which blocks were erased ?
 * @param blockGroup
 * @return output blocks to recover
 */
protected ECBlock[] getOutputBlocks(ECBlockGroup blockGroup) {
  ECBlock[] outputBlocks = new ECBlock[getNumErasedBlocks(blockGroup)];

  int idx = 0;

  for (int i = 0; i < getNumDataUnits(); i++) {
    if (blockGroup.getDataBlocks()[i].isErased()) {
      outputBlocks[idx++] = blockGroup.getDataBlocks()[i];
    }
  }

  for (int i = 0; i < getNumParityUnits(); i++) {
    if (blockGroup.getParityBlocks()[i].isErased()) {
      outputBlocks[idx++] = blockGroup.getParityBlocks()[i];
    }
  }

  return outputBlocks;
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:25,代码来源:AbstractErasureDecoder.java

示例2: getOutputBlocks

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入方法依赖的package包/类
/**
 * Which blocks were erased ? For XOR it's simple we only allow and return one
 * erased block, either data or parity.
 * @param blockGroup
 * @return output blocks to recover
 */
@Override
protected ECBlock[] getOutputBlocks(ECBlockGroup blockGroup) {
  /**
   * If more than one blocks (either data or parity) erased, then it's not
   * edible to recover. We don't have the check here since it will be done
   * by upper level: ErasreCoder call can be avoid if not possible to recover
   * at all.
   */
  int erasedNum = getNumErasedBlocks(blockGroup);
  ECBlock[] outputBlocks = new ECBlock[erasedNum];

  int idx = 0;
  for (int i = 0; i < getNumParityUnits(); i++) {
    if (blockGroup.getParityBlocks()[i].isErased()) {
      outputBlocks[idx++] = blockGroup.getParityBlocks()[i];
    }
  }

  for (int i = 0; i < getNumDataUnits(); i++) {
    if (blockGroup.getDataBlocks()[i].isErased()) {
      outputBlocks[idx++] = blockGroup.getDataBlocks()[i];
    }
  }

  return outputBlocks;
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:33,代码来源:XORErasureDecoder.java

示例3: getOutputBlocks

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入方法依赖的package包/类
protected ECBlock[] getOutputBlocks(ECBlockGroup blockGroup) {
  return blockGroup.getParityBlocks();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:4,代码来源:AbstractErasureEncoder.java


注:本文中的org.apache.hadoop.io.erasurecode.ECBlockGroup.getParityBlocks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。