HBASE-13387 Add ByteBufferedCell an extension to Cell - addendum.

This commit is contained in:
anoopsjohn 2015-07-10 15:03:07 +05:30
parent ff122f80b9
commit bff911a8e8
2 changed files with 20 additions and 20 deletions

View File

@ -36,50 +36,50 @@ public abstract class ByteBufferedCell implements Cell {
/** /**
* @return The {@link ByteBuffer} containing the row bytes. * @return The {@link ByteBuffer} containing the row bytes.
*/ */
abstract ByteBuffer getRowByteBuffer(); public abstract ByteBuffer getRowByteBuffer();
/** /**
* @return Position in the {@link ByteBuffer} where row bytes start * @return Position in the {@link ByteBuffer} where row bytes start
*/ */
abstract int getRowPositionInByteBuffer(); public abstract int getRowPositionInByteBuffer();
/** /**
* @return The {@link ByteBuffer} containing the column family bytes. * @return The {@link ByteBuffer} containing the column family bytes.
*/ */
abstract ByteBuffer getFamilyByteBuffer(); public abstract ByteBuffer getFamilyByteBuffer();
/** /**
* @return Position in the {@link ByteBuffer} where column family bytes start * @return Position in the {@link ByteBuffer} where column family bytes start
*/ */
abstract int getFamilyPositionInByteBuffer(); public abstract int getFamilyPositionInByteBuffer();
/** /**
* @return The {@link ByteBuffer} containing the column qualifier bytes. * @return The {@link ByteBuffer} containing the column qualifier bytes.
*/ */
abstract ByteBuffer getQualifierByteBuffer(); public abstract ByteBuffer getQualifierByteBuffer();
/** /**
* @return Position in the {@link ByteBuffer} where column qualifier bytes start * @return Position in the {@link ByteBuffer} where column qualifier bytes start
*/ */
abstract int getQualifierPositionInByteBuffer(); public abstract int getQualifierPositionInByteBuffer();
/** /**
* @return The {@link ByteBuffer} containing the value bytes. * @return The {@link ByteBuffer} containing the value bytes.
*/ */
abstract ByteBuffer getValueByteBuffer(); public abstract ByteBuffer getValueByteBuffer();
/** /**
* @return Position in the {@link ByteBuffer} where value bytes start * @return Position in the {@link ByteBuffer} where value bytes start
*/ */
abstract int getValuePositionInByteBuffer(); public abstract int getValuePositionInByteBuffer();
/** /**
* @return The {@link ByteBuffer} containing the tag bytes. * @return The {@link ByteBuffer} containing the tag bytes.
*/ */
abstract ByteBuffer getTagsByteBuffer(); public abstract ByteBuffer getTagsByteBuffer();
/** /**
* @return Position in the {@link ByteBuffer} where tag bytes start * @return Position in the {@link ByteBuffer} where tag bytes start
*/ */
abstract int getTagsPositionInByteBuffer(); public abstract int getTagsPositionInByteBuffer();
} }

View File

@ -660,52 +660,52 @@ public class TestCellUtil {
} }
@Override @Override
ByteBuffer getRowByteBuffer() { public ByteBuffer getRowByteBuffer() {
return this.buffer; return this.buffer;
} }
@Override @Override
int getRowPositionInByteBuffer() { public int getRowPositionInByteBuffer() {
return this.offset + KeyValue.ROW_KEY_OFFSET; return this.offset + KeyValue.ROW_KEY_OFFSET;
} }
@Override @Override
ByteBuffer getFamilyByteBuffer() { public ByteBuffer getFamilyByteBuffer() {
return this.buffer; return this.buffer;
} }
@Override @Override
int getFamilyPositionInByteBuffer() { public int getFamilyPositionInByteBuffer() {
return this.offset + KeyValue.ROW_KEY_OFFSET + getRowLength() + Bytes.SIZEOF_BYTE; return this.offset + KeyValue.ROW_KEY_OFFSET + getRowLength() + Bytes.SIZEOF_BYTE;
} }
@Override @Override
ByteBuffer getQualifierByteBuffer() { public ByteBuffer getQualifierByteBuffer() {
return this.buffer; return this.buffer;
} }
@Override @Override
int getQualifierPositionInByteBuffer() { public int getQualifierPositionInByteBuffer() {
return getFamilyPositionInByteBuffer() + getFamilyLength(); return getFamilyPositionInByteBuffer() + getFamilyLength();
} }
@Override @Override
ByteBuffer getValueByteBuffer() { public ByteBuffer getValueByteBuffer() {
return this.buffer; return this.buffer;
} }
@Override @Override
int getValuePositionInByteBuffer() { public int getValuePositionInByteBuffer() {
return this.offset + KeyValue.ROW_OFFSET + getKeyLength(); return this.offset + KeyValue.ROW_OFFSET + getKeyLength();
} }
@Override @Override
ByteBuffer getTagsByteBuffer() { public ByteBuffer getTagsByteBuffer() {
return this.buffer; return this.buffer;
} }
@Override @Override
int getTagsPositionInByteBuffer() { public int getTagsPositionInByteBuffer() {
int tagsLen = getTagsLength(); int tagsLen = getTagsLength();
if (tagsLen == 0) { if (tagsLen == 0) {
return this.offset + this.length; return this.offset + this.length;