本文整理汇总了Java中org.apache.hadoop.util.DataChecksum.CHECKSUM_NULL属性的典型用法代码示例。如果您正苦于以下问题:Java DataChecksum.CHECKSUM_NULL属性的具体用法?Java DataChecksum.CHECKSUM_NULL怎么用?Java DataChecksum.CHECKSUM_NULL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.hadoop.util.DataChecksum
的用法示例。
在下文中一共展示了DataChecksum.CHECKSUM_NULL属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BlockReaderLocal
private BlockReaderLocal(Builder builder) {
this.replica = builder.replica;
this.dataIn = replica.getDataStream().getChannel();
this.dataPos = builder.dataPos;
this.checksumIn = replica.getMetaStream().getChannel();
BlockMetadataHeader header = builder.replica.getMetaHeader();
this.checksum = header.getChecksum();
this.verifyChecksum = builder.verifyChecksum &&
(this.checksum.getChecksumType().id != DataChecksum.CHECKSUM_NULL);
this.filename = builder.filename;
this.block = builder.block;
this.bytesPerChecksum = checksum.getBytesPerChecksum();
this.checksumSize = checksum.getChecksumSize();
this.maxAllocatedChunks = (bytesPerChecksum == 0) ? 0 :
((builder.bufferSize + bytesPerChecksum - 1) / bytesPerChecksum);
// Calculate the effective maximum readahead.
// We can't do more readahead than there is space in the buffer.
int maxReadaheadChunks = (bytesPerChecksum == 0) ? 0 :
((Math.min(builder.bufferSize, builder.maxReadahead) +
bytesPerChecksum - 1) / bytesPerChecksum);
if (maxReadaheadChunks == 0) {
this.zeroReadaheadRequested = true;
maxReadaheadChunks = 1;
} else {
this.zeroReadaheadRequested = false;
}
this.maxReadaheadLength = maxReadaheadChunks * bytesPerChecksum;
this.storageType = builder.storageType;
}
示例2: BlockReaderLocal
private BlockReaderLocal(Builder builder) {
this.replica = builder.replica;
this.dataIn = replica.getDataStream().getChannel();
this.dataPos = builder.dataPos;
this.checksumIn = replica.getMetaStream().getChannel();
BlockMetadataHeader header = builder.replica.getMetaHeader();
this.checksum = header.getChecksum();
this.verifyChecksum = builder.verifyChecksum &&
(this.checksum.getChecksumType().id != DataChecksum.CHECKSUM_NULL);
this.filename = builder.filename;
this.block = builder.block;
this.bytesPerChecksum = checksum.getBytesPerChecksum();
this.checksumSize = checksum.getChecksumSize();
this.maxAllocatedChunks = (bytesPerChecksum == 0) ? 0 :
((builder.bufferSize + bytesPerChecksum - 1) / bytesPerChecksum);
// Calculate the effective maximum readahead.
// We can't do more readahead than there is space in the buffer.
int maxReadaheadChunks = (bytesPerChecksum == 0) ? 0 :
((Math.min(builder.bufferSize, builder.maxReadahead) +
bytesPerChecksum - 1) / bytesPerChecksum);
if (maxReadaheadChunks == 0) {
this.zeroReadaheadRequested = true;
maxReadaheadChunks = 1;
} else {
this.zeroReadaheadRequested = false;
}
this.maxReadaheadLength = maxReadaheadChunks * bytesPerChecksum;
this.storageType = builder.storageType;
this.tracer = builder.tracer;
}