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


Java DataTransferProtocol类代码示例

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


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

示例1: DataTransfer

import org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferProtocol; //导入依赖的package包/类
/**
 * Connect to the first item in the target list.  Pass along the 
 * entire target list, the block, and the data.
 */
DataTransfer(DatanodeInfo targets[], StorageType[] targetStorageTypes,
    ExtendedBlock b, BlockConstructionStage stage,
    final String clientname)  {
  if (DataTransferProtocol.LOG.isDebugEnabled()) {
    DataTransferProtocol.LOG.debug(getClass().getSimpleName() + ": "
        + b + " (numBytes=" + b.getNumBytes() + ")"
        + ", stage=" + stage
        + ", clientname=" + clientname
        + ", targets=" + Arrays.asList(targets)
        + ", target storage types=" + (targetStorageTypes == null ? "[]" :
        Arrays.asList(targetStorageTypes)));
  }
  this.targets = targets;
  this.targetStorageTypes = targetStorageTypes;
  this.b = b;
  this.stage = stage;
  BPOfferService bpos = blockPoolManager.get(b.getBlockPoolId());
  bpReg = bpos.bpRegistration;
  this.clientname = clientname;
  this.cachingStrategy =
      new CachingStrategy(true, getDnConf().readaheadLength);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:27,代码来源:DataNode.java

示例2: DataTransfer

import org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferProtocol; //导入依赖的package包/类
/**
 * Connect to the first item in the target list.  Pass along the 
 * entire target list, the block, and the data.
 */
DataTransfer(DatanodeInfo targets[], StorageType[] targetStorageTypes,
    ExtendedBlock b, BlockConstructionStage stage,
    final String clientname) {
  if (DataTransferProtocol.LOG.isDebugEnabled()) {
    DataTransferProtocol.LOG.debug(getClass().getSimpleName() + ": "
        + b + " (numBytes=" + b.getNumBytes() + ")"
        + ", stage=" + stage
        + ", clientname=" + clientname
        + ", targets=" + Arrays.asList(targets)
        + ", target storage types=" + (targetStorageTypes == null ? "[]" :
        Arrays.asList(targetStorageTypes)));
  }
  this.targets = targets;
  this.targetStorageTypes = targetStorageTypes;
  this.b = b;
  this.stage = stage;
  BPOfferService bpos = blockPoolManager.get(b.getBlockPoolId());
  bpReg = bpos.bpRegistration;
  this.clientname = clientname;
  this.cachingStrategy =
      new CachingStrategy(true, getDnConf().readaheadLength);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:27,代码来源:DataNode.java

示例3: DataTransfer

import org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferProtocol; //导入依赖的package包/类
/**
 * Connect to the first item in the target list.  Pass along the 
 * entire target list, the block, and the data.
 */
DataTransfer(DatanodeInfo targets[], ExtendedBlock b, BlockConstructionStage stage,
    final String clientname)  {
  if (DataTransferProtocol.LOG.isDebugEnabled()) {
    DataTransferProtocol.LOG.debug(getClass().getSimpleName() + ": "
        + b + " (numBytes=" + b.getNumBytes() + ")"
        + ", stage=" + stage
        + ", clientname=" + clientname
        + ", targests=" + Arrays.asList(targets));
  }
  this.targets = targets;
  this.b = b;
  this.stage = stage;
  BPOfferService bpos = blockPoolManager.get(b.getBlockPoolId());
  bpReg = bpos.bpRegistration;
  this.clientname = clientname;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:21,代码来源:DataNode.java

示例4: DataTransfer

import org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferProtocol; //导入依赖的package包/类
/**
 * Connect to the first item in the target list.  Pass along the
 * entire target list, the block, and the data.
 */
DataTransfer(DatanodeInfo targets[], ExtendedBlock b,
    BlockConstructionStage stage, final String clientname) {
  if (DataTransferProtocol.LOG.isDebugEnabled()) {
    DataTransferProtocol.LOG.debug(
        getClass().getSimpleName() + ": " + b + " (numBytes=" +
            b.getNumBytes() + ")" + ", stage=" + stage + ", clientname=" +
            clientname + ", targests=" + Arrays.asList(targets));
  }
  this.targets = targets;
  this.b = b;
  this.stage = stage;
  BPOfferService bpos = blockPoolManager.get(b.getBlockPoolId());
  bpReg = bpos.bpRegistration;
  this.clientname = clientname;
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:20,代码来源:DataNode.java

示例5: testPreadDFSNoChecksum

import org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferProtocol; //导入依赖的package包/类
@Test
public void testPreadDFSNoChecksum() throws IOException {
  Configuration conf = new Configuration();
  ((Log4JLogger)DataTransferProtocol.LOG).getLogger().setLevel(Level.ALL);
  dfsPreadTest(conf, false, false);
  dfsPreadTest(conf, true, false);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestPread.java

示例6: testPreadDFSNoChecksum

import org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferProtocol; //导入依赖的package包/类
@Test
public void testPreadDFSNoChecksum() throws IOException {
  Configuration conf = new Configuration();
  GenericTestUtils.setLogLevel(DataTransferProtocol.LOG, Level.ALL);
  dfsPreadTest(conf, false, false);
  dfsPreadTest(conf, true, false);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:8,代码来源:TestPread.java

示例7: requestWriteBlock

import org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferProtocol; //导入依赖的package包/类
private static void requestWriteBlock(Channel channel, Enum<?> storageType,
    OpWriteBlockProto.Builder writeBlockProtoBuilder) throws IOException {
  OpWriteBlockProto proto = STORAGE_TYPE_SETTER.set(writeBlockProtoBuilder, storageType).build();
  int protoLen = proto.getSerializedSize();
  ByteBuf buffer =
      channel.alloc().buffer(3 + CodedOutputStream.computeRawVarint32Size(protoLen) + protoLen);
  buffer.writeShort(DataTransferProtocol.DATA_TRANSFER_VERSION);
  buffer.writeByte(Op.WRITE_BLOCK.code);
  proto.writeDelimitedTo(new ByteBufOutputStream(buffer));
  channel.writeAndFlush(buffer);
}
 
开发者ID:apache,项目名称:hbase,代码行数:12,代码来源:FanOutOneBlockAsyncDFSOutputHelper.java

示例8: testPreadDFSNoChecksum

import org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferProtocol; //导入依赖的package包/类
@Test
public void testPreadDFSNoChecksum() throws IOException {
  ((Log4JLogger)DataTransferProtocol.LOG).getLogger().setLevel(Level.ALL);
  dfsPreadTest(false, false);
  dfsPreadTest(true, false);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:7,代码来源:TestPread.java

示例9: testPreadDFSNoChecksum

import org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferProtocol; //导入依赖的package包/类
@Test
public void testPreadDFSNoChecksum() throws IOException {
  ((Log4JLogger) DataTransferProtocol.LOG).getLogger().setLevel(Level.ALL);
  dfsPreadTest(false, false);
  dfsPreadTest(true, false);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:7,代码来源:TestPread.java


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