public Cell toCell() { // Buffer backing the value and tags part from the HFileBlock's buffer // When tag compression in use, this will be only the value bytes area. ByteBuffer valAndTagsBuffer; int vOffset; int valAndTagsLength = this.valueLength; int tagsLenSerializationSize = 0; if (this.includeTags && this.tagCompressionContext == null) { // Include the tags part also. This will be the tags bytes + 2 bytes of for storing tags // length tagsLenSerializationSize = this.tagsOffset - (this.valueOffset + this.valueLength); valAndTagsLength += tagsLenSerializationSize + this.tagsLength; } this.currentBuffer.asSubByteBuffer(this.valueOffset, valAndTagsLength, this.tmpPair); valAndTagsBuffer = this.tmpPair.getFirst(); vOffset = this.tmpPair.getSecond();// This is the offset to value part in the BB if (valAndTagsBuffer.hasArray()) { return toOnheapCell(valAndTagsBuffer, vOffset, tagsLenSerializationSize); } else { return toOffheapCell(valAndTagsBuffer, vOffset, tagsLenSerializationSize); } }
public Cell toCell() { // Buffer backing the value and tags part from the HFileBlock's buffer // When tag compression in use, this will be only the value bytes area. ByteBuffer valAndTagsBuffer; int vOffset; int valAndTagsLength = this.valueLength; int tagsLenSerializationSize = 0; if (this.includeTags && this.tagCompressionContext == null) { // Include the tags part also. This will be the tags bytes + 2 bytes of for storing tags // length tagsLenSerializationSize = this.tagsOffset - (this.valueOffset + this.valueLength); valAndTagsLength += tagsLenSerializationSize + this.tagsLength; } this.currentBuffer.asSubByteBuffer(this.valueOffset, valAndTagsLength, this.tmpPair); valAndTagsBuffer = this.tmpPair.getFirst(); vOffset = this.tmpPair.getSecond();// This is the offset to value part in the BB if (valAndTagsBuffer.hasArray()) { return toOnheapCell(valAndTagsBuffer, vOffset, tagsLenSerializationSize); } else { return toOffheapCell(valAndTagsBuffer, vOffset, tagsLenSerializationSize); } }
public Cell toCell() { // Buffer backing the value and tags part from the HFileBlock's buffer // When tag compression in use, this will be only the value bytes area. ByteBuffer valAndTagsBuffer; int vOffset; int valAndTagsLength = this.valueLength; int tagsLenSerializationSize = 0; if (this.includeTags && this.tagCompressionContext == null) { // Include the tags part also. This will be the tags bytes + 2 bytes of for storing tags // length tagsLenSerializationSize = this.tagsOffset - (this.valueOffset + this.valueLength); valAndTagsLength += tagsLenSerializationSize + this.tagsLength; } this.currentBuffer.asSubByteBuffer(this.valueOffset, valAndTagsLength, this.tmpPair); valAndTagsBuffer = this.tmpPair.getFirst(); vOffset = this.tmpPair.getSecond();// This is the offset to value part in the BB if (valAndTagsBuffer.hasArray()) { return toOnheapCell(valAndTagsBuffer, vOffset, tagsLenSerializationSize); } else { return toOffheapCell(valAndTagsBuffer, vOffset, tagsLenSerializationSize); } }