本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}