下面列出了org.apache.hadoop.hbase.HConstants#EMPTY_BYTE_BUFFER 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
private Cell toOffheapCell(ByteBuffer valAndTagsBuffer, int vOffset,
int tagsLenSerializationSize) {
ByteBuffer tagsBuf = HConstants.EMPTY_BYTE_BUFFER;
int tOffset = 0;
if (this.includeTags) {
if (this.tagCompressionContext == null) {
tagsBuf = valAndTagsBuffer;
tOffset = vOffset + this.valueLength + tagsLenSerializationSize;
} else {
tagsBuf = ByteBuffer.wrap(Bytes.copy(tagsBuffer, 0, this.tagsLength));
tOffset = 0;
}
}
return new OffheapDecodedExtendedCell(
ByteBuffer.wrap(Bytes.copy(keyBuffer, 0, this.keyLength)), currentKey.getRowLength(),
currentKey.getFamilyOffset(), currentKey.getFamilyLength(),
currentKey.getQualifierOffset(), currentKey.getQualifierLength(),
currentKey.getTimestamp(), currentKey.getTypeByte(), valAndTagsBuffer, vOffset,
this.valueLength, memstoreTS, tagsBuf, tOffset, this.tagsLength);
}
@Override
public ByteBuffer getValueByteBuffer() {
if (lenAsVal) {
return ByteBuffer.wrap(Bytes.toBytes(cell.getValueLength()));
} else {
return HConstants.EMPTY_BYTE_BUFFER;
}
}
@Override
public ByteBuffer getTagsByteBuffer() {
return HConstants.EMPTY_BYTE_BUFFER;
}