本文整理汇总了Java中org.apache.hadoop.io.erasurecode.ECBlockGroup.getDataBlocks方法的典型用法代码示例。如果您正苦于以下问题:Java ECBlockGroup.getDataBlocks方法的具体用法?Java ECBlockGroup.getDataBlocks怎么用?Java ECBlockGroup.getDataBlocks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.io.erasurecode.ECBlockGroup
的用法示例。
在下文中一共展示了ECBlockGroup.getDataBlocks方法的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;
}
示例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;
}
示例3: getInputBlocks
import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入方法依赖的package包/类
protected ECBlock[] getInputBlocks(ECBlockGroup blockGroup) {
return blockGroup.getDataBlocks();
}