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


Java ECBlockGroup类代码示例

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


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

示例1: prepareDecodingStep

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入依赖的package包/类
@Override
protected ErasureCodingStep prepareDecodingStep(
        final ECBlockGroup blockGroup) {

  RawErasureDecoder rawDecoder;
  RawErasureEncoder rawEncoder;

  ECBlock[] inputBlocks = getInputBlocks(blockGroup);
  ECBlock[] outputBlocks = getOutputBlocks(blockGroup);

  rawDecoder = checkCreateRSRawDecoder();
  rawEncoder = checkCreateXorRawEncoder();

  return new HHXORErasureDecodingStep(inputBlocks,
          getErasedIndexes(inputBlocks), outputBlocks, rawDecoder,
          rawEncoder);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:18,代码来源:HHXORErasureDecoder.java

示例2: 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

示例3: prepareEncodingStep

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入依赖的package包/类
@Override
protected ErasureCodingStep prepareEncodingStep(
        final ECBlockGroup blockGroup) {

  RawErasureEncoder rsRawEncoderTmp = checkCreateRSRawEncoder();
  RawErasureEncoder xorRawEncoderTmp = checkCreateXorRawEncoder();

  ECBlock[] inputBlocks = getInputBlocks(blockGroup);

  return new HHXORErasureEncodingStep(inputBlocks,
          getOutputBlocks(blockGroup), rsRawEncoderTmp, xorRawEncoderTmp);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:13,代码来源:HHXORErasureEncoder.java

示例4: prepareDecodingStep

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入依赖的package包/类
@Override
protected ErasureCodingStep prepareDecodingStep(
    final ECBlockGroup blockGroup) {
  RawErasureDecoder rawDecoder = CodecUtil.createXORRawDecoder(getConf(),
      getNumDataUnits(), getNumParityUnits());

  ECBlock[] inputBlocks = getInputBlocks(blockGroup);

  return new ErasureDecodingStep(inputBlocks,
      getErasedIndexes(inputBlocks),
      getOutputBlocks(blockGroup), rawDecoder);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:13,代码来源:XORErasureDecoder.java

示例5: 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

示例6: prepareEncodingStep

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入依赖的package包/类
@Override
protected ErasureCodingStep prepareEncodingStep(
    final ECBlockGroup blockGroup) {
  RawErasureEncoder rawEncoder = CodecUtil.createXORRawEncoder(getConf(),
      getNumDataUnits(), getNumParityUnits());

  ECBlock[] inputBlocks = getInputBlocks(blockGroup);

  return new ErasureEncodingStep(inputBlocks,
      getOutputBlocks(blockGroup), rawEncoder);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:12,代码来源:XORErasureEncoder.java

示例7: getInputBlocks

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入依赖的package包/类
/**
 * We have all the data blocks and parity blocks as input blocks for
 * recovering by default. It's codec specific
 * @param blockGroup
 * @return input blocks
 */
protected ECBlock[] getInputBlocks(ECBlockGroup blockGroup) {
  ECBlock[] inputBlocks = new ECBlock[getNumDataUnits() +
          getNumParityUnits()];

  System.arraycopy(blockGroup.getDataBlocks(), 0, inputBlocks,
          0, getNumDataUnits());

  System.arraycopy(blockGroup.getParityBlocks(), 0, inputBlocks,
          getNumDataUnits(), getNumParityUnits());

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

示例8: prepareDecodingStep

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入依赖的package包/类
@Override
protected ErasureCodingStep prepareDecodingStep(final ECBlockGroup blockGroup) {

  ECBlock[] inputBlocks = getInputBlocks(blockGroup);
  ECBlock[] outputBlocks = getOutputBlocks(blockGroup);

  RawErasureDecoder rawDecoder = checkCreateRSRawDecoder();
  return new ErasureDecodingStep(inputBlocks,
      getErasedIndexes(inputBlocks), outputBlocks, rawDecoder);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:11,代码来源:RSErasureDecoder.java

示例9: makeBlockGroup

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入依赖的package包/类
/**
 * Calculating and organizing BlockGroup, to be called by ECManager
 * @param dataBlocks Data blocks to compute parity blocks against
 * @param parityBlocks To be computed parity blocks
 * @return
 */
public ECBlockGroup makeBlockGroup(ECBlock[] dataBlocks,
                                   ECBlock[] parityBlocks) {

  ECBlockGroup blockGroup = new ECBlockGroup(dataBlocks, parityBlocks);
  return blockGroup;
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:13,代码来源:BlockGrouper.java

示例10: prepareBlockGroupForEncoding

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入依赖的package包/类
/**
 * Prepare a block group for encoding.
 * @return
 */
protected ECBlockGroup prepareBlockGroupForEncoding() {
  ECBlock[] dataBlocks = new TestBlock[numDataUnits];
  ECBlock[] parityBlocks = new TestBlock[numParityUnits];

  for (int i = 0; i < numDataUnits; i++) {
    dataBlocks[i] = generateDataBlock();
  }

  for (int i = 0; i < numParityUnits; i++) {
    parityBlocks[i] = allocateOutputBlock();
  }

  return new ECBlockGroup(dataBlocks, parityBlocks);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:19,代码来源:TestErasureCoderBase.java

示例11: getInputBlocks

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入依赖的package包/类
/**
 * We have all the data blocks and parity blocks as input blocks for
 * recovering by default. It's codec specific
 * @param blockGroup
 * @return
 */
protected ECBlock[] getInputBlocks(ECBlockGroup blockGroup) {
  ECBlock[] inputBlocks = new ECBlock[getNumDataUnits() +
          getNumParityUnits()];

  System.arraycopy(blockGroup.getDataBlocks(), 0, inputBlocks,
          0, getNumDataUnits());

  System.arraycopy(blockGroup.getParityBlocks(), 0, inputBlocks,
          getNumDataUnits(), getNumParityUnits());

  return inputBlocks;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:19,代码来源:AbstractErasureDecoder.java

示例12: prepareDecodingStep

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入依赖的package包/类
@Override
protected ErasureCodingStep prepareDecodingStep(
    final ECBlockGroup blockGroup) {
  ErasureCoderOptions coderOptions = new ErasureCoderOptions(
      getNumDataUnits(), getNumParityUnits());
  RawErasureDecoder rawDecoder = CodecUtil.createRawDecoder(getConf(),
      ErasureCodeConstants.XOR_CODEC_NAME, coderOptions);

  ECBlock[] inputBlocks = getInputBlocks(blockGroup);

  return new ErasureDecodingStep(inputBlocks,
      getErasedIndexes(inputBlocks),
      getOutputBlocks(blockGroup), rawDecoder);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:15,代码来源:XORErasureDecoder.java

示例13: prepareEncodingStep

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入依赖的package包/类
@Override
protected ErasureCodingStep prepareEncodingStep(
    final ECBlockGroup blockGroup) {
  ErasureCoderOptions coderOptions = new ErasureCoderOptions(
      getNumDataUnits(), getNumParityUnits());
  RawErasureEncoder rawEncoder = CodecUtil.createRawEncoder(getConf(),
      ErasureCodeConstants.XOR_CODEC_NAME, coderOptions);

  ECBlock[] inputBlocks = getInputBlocks(blockGroup);

  return new ErasureEncodingStep(inputBlocks,
      getOutputBlocks(blockGroup), rawEncoder);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:14,代码来源:XORErasureEncoder.java

示例14: calculateCoding

import org.apache.hadoop.io.erasurecode.ECBlockGroup; //导入依赖的package包/类
@Override
public ErasureCodingStep calculateCoding(ECBlockGroup blockGroup) {
  // We may have more than this when considering complicate cases. HADOOP-11550
  return prepareEncodingStep(blockGroup);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:6,代码来源:AbstractErasureEncoder.java

示例15: getInputBlocks

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


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