HBASE-14590 Shorten ByteBufferedCell#getXXXPositionInByteBuffer method name (Anoop Sam John)
This commit is contained in:
parent
4d1d88aa15
commit
b9639d1e82
|
@ -93,7 +93,7 @@ public class ColumnPrefixFilter extends FilterBase {
|
|||
private static int compareQualifierPart(Cell cell, int length, byte[] prefix) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.compareTo(((ByteBufferedCell) cell).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) cell).getQualifierPositionInByteBuffer(), length, prefix, 0, length);
|
||||
((ByteBufferedCell) cell).getQualifierPosition(), length, prefix, 0, length);
|
||||
}
|
||||
return Bytes.compareTo(cell.getQualifierArray(), cell.getQualifierOffset(), length, prefix, 0,
|
||||
length);
|
||||
|
|
|
@ -63,7 +63,7 @@ public class PrefixFilter extends FilterBase {
|
|||
int cmp;
|
||||
if (firstRowCell instanceof ByteBufferedCell) {
|
||||
cmp = ByteBufferUtils.compareTo(((ByteBufferedCell) firstRowCell).getRowByteBuffer(),
|
||||
((ByteBufferedCell) firstRowCell).getRowPositionInByteBuffer(), this.prefix.length,
|
||||
((ByteBufferedCell) firstRowCell).getRowPosition(), this.prefix.length,
|
||||
this.prefix, 0, this.prefix.length);
|
||||
} else {
|
||||
cmp = Bytes.compareTo(firstRowCell.getRowArray(), firstRowCell.getRowOffset(),
|
||||
|
|
|
@ -54,7 +54,7 @@ public abstract class ByteBufferedCell implements Cell {
|
|||
/**
|
||||
* @return Position in the {@link ByteBuffer} where row bytes start
|
||||
*/
|
||||
public abstract int getRowPositionInByteBuffer();
|
||||
public abstract int getRowPosition();
|
||||
|
||||
/**
|
||||
* @return The {@link ByteBuffer} containing the column family bytes.
|
||||
|
@ -64,7 +64,7 @@ public abstract class ByteBufferedCell implements Cell {
|
|||
/**
|
||||
* @return Position in the {@link ByteBuffer} where column family bytes start
|
||||
*/
|
||||
public abstract int getFamilyPositionInByteBuffer();
|
||||
public abstract int getFamilyPosition();
|
||||
|
||||
/**
|
||||
* @return The {@link ByteBuffer} containing the column qualifier bytes.
|
||||
|
@ -74,7 +74,7 @@ public abstract class ByteBufferedCell implements Cell {
|
|||
/**
|
||||
* @return Position in the {@link ByteBuffer} where column qualifier bytes start
|
||||
*/
|
||||
public abstract int getQualifierPositionInByteBuffer();
|
||||
public abstract int getQualifierPosition();
|
||||
|
||||
/**
|
||||
* @return The {@link ByteBuffer} containing the value bytes.
|
||||
|
@ -84,7 +84,7 @@ public abstract class ByteBufferedCell implements Cell {
|
|||
/**
|
||||
* @return Position in the {@link ByteBuffer} where value bytes start
|
||||
*/
|
||||
public abstract int getValuePositionInByteBuffer();
|
||||
public abstract int getValuePosition();
|
||||
|
||||
/**
|
||||
* @return The {@link ByteBuffer} containing the tag bytes.
|
||||
|
@ -94,5 +94,5 @@ public abstract class ByteBufferedCell implements Cell {
|
|||
/**
|
||||
* @return Position in the {@link ByteBuffer} where tag bytes start
|
||||
*/
|
||||
public abstract int getTagsPositionInByteBuffer();
|
||||
public abstract int getTagsPosition();
|
||||
}
|
|
@ -73,7 +73,7 @@ public class ByteBufferedKeyOnlyKeyValue extends ByteBufferedCell {
|
|||
@Override
|
||||
public int getRowOffset() {
|
||||
if (this.buf.hasArray()) {
|
||||
return getRowPositionInByteBuffer() + this.buf.arrayOffset();
|
||||
return getRowPosition() + this.buf.arrayOffset();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class ByteBufferedKeyOnlyKeyValue extends ByteBufferedCell {
|
|||
@Override
|
||||
public int getFamilyOffset() {
|
||||
if (this.buf.hasArray()) {
|
||||
return getFamilyPositionInByteBuffer() + this.buf.arrayOffset();
|
||||
return getFamilyPosition() + this.buf.arrayOffset();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ public class ByteBufferedKeyOnlyKeyValue extends ByteBufferedCell {
|
|||
@Override
|
||||
public int getQualifierOffset() {
|
||||
if (this.buf.hasArray()) {
|
||||
return getQualifierPositionInByteBuffer() + this.buf.arrayOffset();
|
||||
return getQualifierPosition() + this.buf.arrayOffset();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ public class ByteBufferedKeyOnlyKeyValue extends ByteBufferedCell {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRowPositionInByteBuffer() {
|
||||
public int getRowPosition() {
|
||||
return this.offset + Bytes.SIZEOF_SHORT;
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ public class ByteBufferedKeyOnlyKeyValue extends ByteBufferedCell {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getFamilyPositionInByteBuffer() {
|
||||
public int getFamilyPosition() {
|
||||
return getFamilyLengthPosition() + Bytes.SIZEOF_BYTE;
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ public class ByteBufferedKeyOnlyKeyValue extends ByteBufferedCell {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getQualifierPositionInByteBuffer() {
|
||||
public int getQualifierPosition() {
|
||||
int famLenPos = getFamilyLengthPosition();
|
||||
return famLenPos + Bytes.SIZEOF_BYTE + getFamilyLength(famLenPos);
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ public class ByteBufferedKeyOnlyKeyValue extends ByteBufferedCell {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getValuePositionInByteBuffer() {
|
||||
public int getValuePosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -234,7 +234,7 @@ public class ByteBufferedKeyOnlyKeyValue extends ByteBufferedCell {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getTagsPositionInByteBuffer() {
|
||||
public int getTagsPosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -161,18 +161,18 @@ public class CellComparator implements Comparator<Cell>, Serializable {
|
|||
public final static int compareFamilies(Cell left, Cell right) {
|
||||
if (left instanceof ByteBufferedCell && right instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.compareTo(((ByteBufferedCell) left).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) left).getFamilyPositionInByteBuffer(), left.getFamilyLength(),
|
||||
((ByteBufferedCell) left).getFamilyPosition(), left.getFamilyLength(),
|
||||
((ByteBufferedCell) right).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) right).getFamilyPositionInByteBuffer(), right.getFamilyLength());
|
||||
((ByteBufferedCell) right).getFamilyPosition(), right.getFamilyLength());
|
||||
}
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.compareTo(((ByteBufferedCell) left).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) left).getFamilyPositionInByteBuffer(), left.getFamilyLength(),
|
||||
((ByteBufferedCell) left).getFamilyPosition(), left.getFamilyLength(),
|
||||
right.getFamilyArray(), right.getFamilyOffset(), right.getFamilyLength());
|
||||
}
|
||||
if (right instanceof ByteBufferedCell) {
|
||||
return -(ByteBufferUtils.compareTo(((ByteBufferedCell) right).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) right).getFamilyPositionInByteBuffer(), right.getFamilyLength(),
|
||||
((ByteBufferedCell) right).getFamilyPosition(), right.getFamilyLength(),
|
||||
left.getFamilyArray(), left.getFamilyOffset(), left.getFamilyLength()));
|
||||
}
|
||||
return Bytes.compareTo(left.getFamilyArray(), left.getFamilyOffset(), left.getFamilyLength(),
|
||||
|
@ -182,7 +182,7 @@ public class CellComparator implements Comparator<Cell>, Serializable {
|
|||
private final static int compareFamilies(Cell left, byte[] right, int roffset, int rlength) {
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.compareTo(((ByteBufferedCell) left).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) left).getFamilyPositionInByteBuffer(), left.getFamilyLength(), right,
|
||||
((ByteBufferedCell) left).getFamilyPosition(), left.getFamilyLength(), right,
|
||||
roffset, rlength);
|
||||
}
|
||||
return Bytes.compareTo(left.getFamilyArray(), left.getFamilyOffset(), left.getFamilyLength(),
|
||||
|
@ -199,19 +199,19 @@ public class CellComparator implements Comparator<Cell>, Serializable {
|
|||
if (left instanceof ByteBufferedCell && right instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils
|
||||
.compareTo(((ByteBufferedCell) left).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) left).getQualifierPositionInByteBuffer(),
|
||||
((ByteBufferedCell) left).getQualifierPosition(),
|
||||
left.getQualifierLength(), ((ByteBufferedCell) right).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) right).getQualifierPositionInByteBuffer(),
|
||||
((ByteBufferedCell) right).getQualifierPosition(),
|
||||
right.getQualifierLength());
|
||||
}
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.compareTo(((ByteBufferedCell) left).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) left).getQualifierPositionInByteBuffer(), left.getQualifierLength(),
|
||||
((ByteBufferedCell) left).getQualifierPosition(), left.getQualifierLength(),
|
||||
right.getQualifierArray(), right.getQualifierOffset(), right.getQualifierLength());
|
||||
}
|
||||
if (right instanceof ByteBufferedCell) {
|
||||
return -(ByteBufferUtils.compareTo(((ByteBufferedCell) right).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) right).getQualifierPositionInByteBuffer(),
|
||||
((ByteBufferedCell) right).getQualifierPosition(),
|
||||
right.getQualifierLength(), left.getQualifierArray(), left.getQualifierOffset(),
|
||||
left.getQualifierLength()));
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ public class CellComparator implements Comparator<Cell>, Serializable {
|
|||
public final static int compareQualifiers(Cell left, byte[] right, int rOffset, int rLength) {
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.compareTo(((ByteBufferedCell) left).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) left).getQualifierPositionInByteBuffer(), left.getQualifierLength(),
|
||||
((ByteBufferedCell) left).getQualifierPosition(), left.getQualifierLength(),
|
||||
right, rOffset, rLength);
|
||||
}
|
||||
return Bytes.compareTo(left.getQualifierArray(), left.getQualifierOffset(),
|
||||
|
@ -317,18 +317,18 @@ public class CellComparator implements Comparator<Cell>, Serializable {
|
|||
public int compareRows(final Cell left, final Cell right) {
|
||||
if (left instanceof ByteBufferedCell && right instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.compareTo(((ByteBufferedCell) left).getRowByteBuffer(),
|
||||
((ByteBufferedCell) left).getRowPositionInByteBuffer(), left.getRowLength(),
|
||||
((ByteBufferedCell) left).getRowPosition(), left.getRowLength(),
|
||||
((ByteBufferedCell) right).getRowByteBuffer(),
|
||||
((ByteBufferedCell) right).getRowPositionInByteBuffer(), right.getRowLength());
|
||||
((ByteBufferedCell) right).getRowPosition(), right.getRowLength());
|
||||
}
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.compareTo(((ByteBufferedCell) left).getRowByteBuffer(),
|
||||
((ByteBufferedCell) left).getRowPositionInByteBuffer(), left.getRowLength(),
|
||||
((ByteBufferedCell) left).getRowPosition(), left.getRowLength(),
|
||||
right.getRowArray(), right.getRowOffset(), right.getRowLength());
|
||||
}
|
||||
if (right instanceof ByteBufferedCell) {
|
||||
return -(ByteBufferUtils.compareTo(((ByteBufferedCell) right).getRowByteBuffer(),
|
||||
((ByteBufferedCell) right).getRowPositionInByteBuffer(), right.getRowLength(),
|
||||
((ByteBufferedCell) right).getRowPosition(), right.getRowLength(),
|
||||
left.getRowArray(), left.getRowOffset(), left.getRowLength()));
|
||||
}
|
||||
return Bytes.compareTo(left.getRowArray(), left.getRowOffset(), left.getRowLength(),
|
||||
|
@ -354,7 +354,7 @@ public class CellComparator implements Comparator<Cell>, Serializable {
|
|||
public int compareRows(Cell left, byte[] right, int roffset, int rlength) {
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.compareTo(((ByteBufferedCell) left).getRowByteBuffer(),
|
||||
((ByteBufferedCell) left).getRowPositionInByteBuffer(), left.getRowLength(), right,
|
||||
((ByteBufferedCell) left).getRowPosition(), left.getRowLength(), right,
|
||||
roffset, rlength);
|
||||
}
|
||||
return Bytes.compareTo(left.getRowArray(), left.getRowOffset(), left.getRowLength(), right,
|
||||
|
@ -506,7 +506,7 @@ public class CellComparator implements Comparator<Cell>, Serializable {
|
|||
public static int compareRow(Cell cell, ByteArrayComparable comparator) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return comparator.compareTo(((ByteBufferedCell) cell).getRowByteBuffer(),
|
||||
((ByteBufferedCell) cell).getRowPositionInByteBuffer(), cell.getRowLength());
|
||||
((ByteBufferedCell) cell).getRowPosition(), cell.getRowLength());
|
||||
}
|
||||
return comparator.compareTo(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
|
||||
}
|
||||
|
@ -520,7 +520,7 @@ public class CellComparator implements Comparator<Cell>, Serializable {
|
|||
public static int compareFamily(Cell cell, ByteArrayComparable comparator) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return comparator.compareTo(((ByteBufferedCell) cell).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) cell).getFamilyPositionInByteBuffer(), cell.getFamilyLength());
|
||||
((ByteBufferedCell) cell).getFamilyPosition(), cell.getFamilyLength());
|
||||
}
|
||||
return comparator.compareTo(cell.getFamilyArray(), cell.getFamilyOffset(),
|
||||
cell.getFamilyLength());
|
||||
|
@ -535,7 +535,7 @@ public class CellComparator implements Comparator<Cell>, Serializable {
|
|||
public static int compareQualifier(Cell cell, ByteArrayComparable comparator) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return comparator.compareTo(((ByteBufferedCell) cell).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) cell).getQualifierPositionInByteBuffer(), cell.getQualifierLength());
|
||||
((ByteBufferedCell) cell).getQualifierPosition(), cell.getQualifierLength());
|
||||
}
|
||||
return comparator.compareTo(cell.getQualifierArray(), cell.getQualifierOffset(),
|
||||
cell.getQualifierLength());
|
||||
|
@ -550,7 +550,7 @@ public class CellComparator implements Comparator<Cell>, Serializable {
|
|||
public static int compareValue(Cell cell, ByteArrayComparable comparator) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return comparator.compareTo(((ByteBufferedCell) cell).getValueByteBuffer(),
|
||||
((ByteBufferedCell) cell).getValuePositionInByteBuffer(), cell.getValueLength());
|
||||
((ByteBufferedCell) cell).getValuePosition(), cell.getValueLength());
|
||||
}
|
||||
return comparator.compareTo(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ public final class CellUtil {
|
|||
if (cell instanceof ByteBufferedCell) {
|
||||
ByteBufferUtils.copyFromBufferToArray(destination,
|
||||
((ByteBufferedCell) cell).getRowByteBuffer(),
|
||||
((ByteBufferedCell) cell).getRowPositionInByteBuffer(), destinationOffset, rowLen);
|
||||
((ByteBufferedCell) cell).getRowPosition(), destinationOffset, rowLen);
|
||||
} else {
|
||||
System.arraycopy(cell.getRowArray(), cell.getRowOffset(), destination, destinationOffset,
|
||||
rowLen);
|
||||
|
@ -140,7 +140,7 @@ public final class CellUtil {
|
|||
if (cell instanceof ByteBufferedCell) {
|
||||
ByteBufferUtils.copyFromBufferToArray(destination,
|
||||
((ByteBufferedCell) cell).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) cell).getFamilyPositionInByteBuffer(), destinationOffset, fLen);
|
||||
((ByteBufferedCell) cell).getFamilyPosition(), destinationOffset, fLen);
|
||||
} else {
|
||||
System.arraycopy(cell.getFamilyArray(), cell.getFamilyOffset(), destination,
|
||||
destinationOffset, fLen);
|
||||
|
@ -153,7 +153,7 @@ public final class CellUtil {
|
|||
if (cell instanceof ByteBufferedCell) {
|
||||
ByteBufferUtils.copyFromBufferToArray(destination,
|
||||
((ByteBufferedCell) cell).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) cell).getQualifierPositionInByteBuffer(), destinationOffset, qlen);
|
||||
((ByteBufferedCell) cell).getQualifierPosition(), destinationOffset, qlen);
|
||||
} else {
|
||||
System.arraycopy(cell.getQualifierArray(), cell.getQualifierOffset(), destination,
|
||||
destinationOffset, qlen);
|
||||
|
@ -166,7 +166,7 @@ public final class CellUtil {
|
|||
if (cell instanceof ByteBufferedCell) {
|
||||
ByteBufferUtils.copyFromBufferToArray(destination,
|
||||
((ByteBufferedCell) cell).getValueByteBuffer(),
|
||||
((ByteBufferedCell) cell).getValuePositionInByteBuffer(), destinationOffset, vlen);
|
||||
((ByteBufferedCell) cell).getValuePosition(), destinationOffset, vlen);
|
||||
} else {
|
||||
System.arraycopy(cell.getValueArray(), cell.getValueOffset(), destination, destinationOffset,
|
||||
vlen);
|
||||
|
@ -186,7 +186,7 @@ public final class CellUtil {
|
|||
if (cell instanceof ByteBufferedCell) {
|
||||
ByteBufferUtils.copyFromBufferToArray(destination,
|
||||
((ByteBufferedCell) cell).getTagsByteBuffer(),
|
||||
((ByteBufferedCell) cell).getTagsPositionInByteBuffer(), destinationOffset, tlen);
|
||||
((ByteBufferedCell) cell).getTagsPosition(), destinationOffset, tlen);
|
||||
} else {
|
||||
System.arraycopy(cell.getTagsArray(), cell.getTagsOffset(), destination, destinationOffset,
|
||||
tlen);
|
||||
|
@ -199,7 +199,7 @@ public final class CellUtil {
|
|||
public static byte getRowByte(Cell cell, int index) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return ((ByteBufferedCell) cell).getRowByteBuffer().get(
|
||||
((ByteBufferedCell) cell).getRowPositionInByteBuffer() + index);
|
||||
((ByteBufferedCell) cell).getRowPosition() + index);
|
||||
}
|
||||
return cell.getRowArray()[cell.getRowOffset() + index];
|
||||
}
|
||||
|
@ -466,7 +466,7 @@ public final class CellUtil {
|
|||
final int length) {
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) left).getRowByteBuffer(),
|
||||
((ByteBufferedCell) left).getRowPositionInByteBuffer(), left.getRowLength(), buf, offset,
|
||||
((ByteBufferedCell) left).getRowPosition(), left.getRowLength(), buf, offset,
|
||||
length);
|
||||
}
|
||||
return Bytes.equals(left.getRowArray(), left.getRowOffset(), left.getRowLength(), buf, offset,
|
||||
|
@ -478,18 +478,18 @@ public final class CellUtil {
|
|||
byte rfamlength = right.getFamilyLength();
|
||||
if (left instanceof ByteBufferedCell && right instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) left).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) left).getFamilyPositionInByteBuffer(), lfamlength,
|
||||
((ByteBufferedCell) left).getFamilyPosition(), lfamlength,
|
||||
((ByteBufferedCell) right).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) right).getFamilyPositionInByteBuffer(), rfamlength);
|
||||
((ByteBufferedCell) right).getFamilyPosition(), rfamlength);
|
||||
}
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) left).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) left).getFamilyPositionInByteBuffer(), lfamlength,
|
||||
((ByteBufferedCell) left).getFamilyPosition(), lfamlength,
|
||||
right.getFamilyArray(), right.getFamilyOffset(), rfamlength);
|
||||
}
|
||||
if (right instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) right).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) right).getFamilyPositionInByteBuffer(), rfamlength,
|
||||
((ByteBufferedCell) right).getFamilyPosition(), rfamlength,
|
||||
left.getFamilyArray(), left.getFamilyOffset(), lfamlength);
|
||||
}
|
||||
return Bytes.equals(left.getFamilyArray(), left.getFamilyOffset(), left.getFamilyLength(),
|
||||
|
@ -507,7 +507,7 @@ public final class CellUtil {
|
|||
final int length) {
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) left).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) left).getFamilyPositionInByteBuffer(), left.getFamilyLength(), buf,
|
||||
((ByteBufferedCell) left).getFamilyPosition(), left.getFamilyLength(), buf,
|
||||
offset, length);
|
||||
}
|
||||
return Bytes.equals(left.getFamilyArray(), left.getFamilyOffset(), left.getFamilyLength(), buf,
|
||||
|
@ -519,18 +519,18 @@ public final class CellUtil {
|
|||
int rqlength = right.getQualifierLength();
|
||||
if (left instanceof ByteBufferedCell && right instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) left).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) left).getQualifierPositionInByteBuffer(), lqlength,
|
||||
((ByteBufferedCell) left).getQualifierPosition(), lqlength,
|
||||
((ByteBufferedCell) right).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) right).getQualifierPositionInByteBuffer(), rqlength);
|
||||
((ByteBufferedCell) right).getQualifierPosition(), rqlength);
|
||||
}
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) left).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) left).getQualifierPositionInByteBuffer(), lqlength,
|
||||
((ByteBufferedCell) left).getQualifierPosition(), lqlength,
|
||||
right.getQualifierArray(), right.getQualifierOffset(), rqlength);
|
||||
}
|
||||
if (right instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) right).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) right).getQualifierPositionInByteBuffer(), rqlength,
|
||||
((ByteBufferedCell) right).getQualifierPosition(), rqlength,
|
||||
left.getQualifierArray(), left.getQualifierOffset(), lqlength);
|
||||
}
|
||||
return Bytes.equals(left.getQualifierArray(), left.getQualifierOffset(),
|
||||
|
@ -568,7 +568,7 @@ public final class CellUtil {
|
|||
}
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) left).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) left).getQualifierPositionInByteBuffer(), left.getQualifierLength(),
|
||||
((ByteBufferedCell) left).getQualifierPosition(), left.getQualifierLength(),
|
||||
buf, offset, length);
|
||||
}
|
||||
return Bytes.equals(left.getQualifierArray(), left.getQualifierOffset(),
|
||||
|
@ -599,18 +599,18 @@ public final class CellUtil {
|
|||
int rvlength = right.getValueLength();
|
||||
if (left instanceof ByteBufferedCell && right instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) left).getValueByteBuffer(),
|
||||
((ByteBufferedCell) left).getValuePositionInByteBuffer(), lvlength,
|
||||
((ByteBufferedCell) left).getValuePosition(), lvlength,
|
||||
((ByteBufferedCell) right).getValueByteBuffer(),
|
||||
((ByteBufferedCell) right).getValuePositionInByteBuffer(), rvlength);
|
||||
((ByteBufferedCell) right).getValuePosition(), rvlength);
|
||||
}
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) left).getValueByteBuffer(),
|
||||
((ByteBufferedCell) left).getValuePositionInByteBuffer(), lvlength,
|
||||
((ByteBufferedCell) left).getValuePosition(), lvlength,
|
||||
right.getValueArray(), right.getValueOffset(), rvlength);
|
||||
}
|
||||
if (right instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) right).getValueByteBuffer(),
|
||||
((ByteBufferedCell) right).getValuePositionInByteBuffer(), rvlength,
|
||||
((ByteBufferedCell) right).getValuePosition(), rvlength,
|
||||
left.getValueArray(), left.getValueOffset(), lvlength);
|
||||
}
|
||||
return Bytes.equals(left.getValueArray(), left.getValueOffset(), lvlength,
|
||||
|
@ -620,7 +620,7 @@ public final class CellUtil {
|
|||
public static boolean matchingValue(final Cell left, final byte[] buf) {
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.compareTo(((ByteBufferedCell) left).getValueByteBuffer(),
|
||||
((ByteBufferedCell) left).getValuePositionInByteBuffer(), left.getValueLength(), buf, 0,
|
||||
((ByteBufferedCell) left).getValuePosition(), left.getValueLength(), buf, 0,
|
||||
buf.length) == 0;
|
||||
}
|
||||
return Bytes.equals(left.getValueArray(), left.getValueOffset(), left.getValueLength(), buf, 0,
|
||||
|
@ -1122,18 +1122,18 @@ public final class CellUtil {
|
|||
if (lrowlength != rrowlength) return false;
|
||||
if (left instanceof ByteBufferedCell && right instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) left).getRowByteBuffer(),
|
||||
((ByteBufferedCell) left).getRowPositionInByteBuffer(), lrowlength,
|
||||
((ByteBufferedCell) left).getRowPosition(), lrowlength,
|
||||
((ByteBufferedCell) right).getRowByteBuffer(),
|
||||
((ByteBufferedCell) right).getRowPositionInByteBuffer(), rrowlength);
|
||||
((ByteBufferedCell) right).getRowPosition(), rrowlength);
|
||||
}
|
||||
if (left instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) left).getRowByteBuffer(),
|
||||
((ByteBufferedCell) left).getRowPositionInByteBuffer(), lrowlength, right.getRowArray(),
|
||||
((ByteBufferedCell) left).getRowPosition(), lrowlength, right.getRowArray(),
|
||||
right.getRowOffset(), rrowlength);
|
||||
}
|
||||
if (right instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.equals(((ByteBufferedCell) right).getRowByteBuffer(),
|
||||
((ByteBufferedCell) right).getRowPositionInByteBuffer(), rrowlength, left.getRowArray(),
|
||||
((ByteBufferedCell) right).getRowPosition(), rrowlength, left.getRowArray(),
|
||||
left.getRowOffset(), lrowlength);
|
||||
}
|
||||
return Bytes.equals(left.getRowArray(), left.getRowOffset(), left.getRowLength(),
|
||||
|
@ -1168,7 +1168,7 @@ public final class CellUtil {
|
|||
public static int getRowAsInt(Cell cell) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.toInt(((ByteBufferedCell) cell).getRowByteBuffer(),
|
||||
((ByteBufferedCell) cell).getRowPositionInByteBuffer());
|
||||
((ByteBufferedCell) cell).getRowPosition());
|
||||
}
|
||||
return Bytes.toInt(cell.getRowArray(), cell.getRowOffset());
|
||||
}
|
||||
|
@ -1182,7 +1182,7 @@ public final class CellUtil {
|
|||
public static long getValueAsLong(Cell cell) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.toLong(((ByteBufferedCell) cell).getValueByteBuffer(),
|
||||
((ByteBufferedCell) cell).getValuePositionInByteBuffer());
|
||||
((ByteBufferedCell) cell).getValuePosition());
|
||||
}
|
||||
return Bytes.toLong(cell.getValueArray(), cell.getValueOffset());
|
||||
}
|
||||
|
@ -1196,7 +1196,7 @@ public final class CellUtil {
|
|||
public static double getValueAsDouble(Cell cell) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.toDouble(((ByteBufferedCell) cell).getValueByteBuffer(),
|
||||
((ByteBufferedCell) cell).getValuePositionInByteBuffer());
|
||||
((ByteBufferedCell) cell).getValuePosition());
|
||||
}
|
||||
return Bytes.toDouble(cell.getValueArray(), cell.getValueOffset());
|
||||
}
|
||||
|
@ -1210,7 +1210,7 @@ public final class CellUtil {
|
|||
public static BigDecimal getValueAsBigDecimal(Cell cell) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return ByteBufferUtils.toBigDecimal(((ByteBufferedCell) cell).getValueByteBuffer(),
|
||||
((ByteBufferedCell) cell).getValuePositionInByteBuffer(), cell.getValueLength());
|
||||
((ByteBufferedCell) cell).getValuePosition(), cell.getValueLength());
|
||||
}
|
||||
return Bytes.toBigDecimal(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
|
||||
}
|
||||
|
@ -1224,7 +1224,7 @@ public final class CellUtil {
|
|||
public static Cell createFirstOnRow(final Cell cell) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return new FirstOnRowByteBufferedCell(((ByteBufferedCell) cell).getRowByteBuffer(),
|
||||
((ByteBufferedCell) cell).getRowPositionInByteBuffer(), cell.getRowLength());
|
||||
((ByteBufferedCell) cell).getRowPosition(), cell.getRowLength());
|
||||
}
|
||||
return new FirstOnRowCell(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
|
||||
}
|
||||
|
@ -1238,10 +1238,10 @@ public final class CellUtil {
|
|||
public static Cell createFirstOnRowCol(final Cell cell) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return new FirstOnRowColByteBufferedCell(((ByteBufferedCell) cell).getRowByteBuffer(),
|
||||
((ByteBufferedCell) cell).getRowPositionInByteBuffer(), cell.getRowLength(),
|
||||
((ByteBufferedCell) cell).getRowPosition(), cell.getRowLength(),
|
||||
HConstants.EMPTY_BYTE_BUFFER, 0, (byte) 0,
|
||||
((ByteBufferedCell) cell).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) cell).getQualifierPositionInByteBuffer(), cell.getQualifierLength());
|
||||
((ByteBufferedCell) cell).getQualifierPosition(), cell.getQualifierLength());
|
||||
}
|
||||
return new FirstOnRowColCell(cell.getRowArray(), cell.getRowOffset(),
|
||||
cell.getRowLength(), HConstants.EMPTY_BYTE_ARRAY, 0, (byte)0, cell.getQualifierArray(),
|
||||
|
@ -1271,9 +1271,9 @@ public final class CellUtil {
|
|||
public static Cell createFirstOnRowCol(final Cell cell, byte[] qArray, int qoffest, int qlength) {
|
||||
if(cell instanceof ByteBufferedCell) {
|
||||
return new FirstOnRowColByteBufferedCell(((ByteBufferedCell) cell).getRowByteBuffer(),
|
||||
((ByteBufferedCell) cell).getRowPositionInByteBuffer(), cell.getRowLength(),
|
||||
((ByteBufferedCell) cell).getRowPosition(), cell.getRowLength(),
|
||||
((ByteBufferedCell) cell).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) cell).getFamilyPositionInByteBuffer(), cell.getFamilyLength(),
|
||||
((ByteBufferedCell) cell).getFamilyPosition(), cell.getFamilyLength(),
|
||||
ByteBuffer.wrap(qArray), qoffest, qlength);
|
||||
}
|
||||
return new FirstOnRowColCell(cell.getRowArray(), cell.getRowOffset(),
|
||||
|
@ -1292,11 +1292,11 @@ public final class CellUtil {
|
|||
public static Cell createFirstOnRowColTS(Cell cell, long ts) {
|
||||
if(cell instanceof ByteBufferedCell) {
|
||||
return new FirstOnRowColTSByteBufferedCell(((ByteBufferedCell) cell).getRowByteBuffer(),
|
||||
((ByteBufferedCell) cell).getRowPositionInByteBuffer(), cell.getRowLength(),
|
||||
((ByteBufferedCell) cell).getRowPosition(), cell.getRowLength(),
|
||||
((ByteBufferedCell) cell).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) cell).getFamilyPositionInByteBuffer(), cell.getFamilyLength(),
|
||||
((ByteBufferedCell) cell).getFamilyPosition(), cell.getFamilyLength(),
|
||||
((ByteBufferedCell) cell).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) cell).getQualifierPositionInByteBuffer(), cell.getQualifierLength(),
|
||||
((ByteBufferedCell) cell).getQualifierPosition(), cell.getQualifierLength(),
|
||||
ts);
|
||||
}
|
||||
return new FirstOnRowColTSCell(cell.getRowArray(), cell.getRowOffset(),
|
||||
|
@ -1313,7 +1313,7 @@ public final class CellUtil {
|
|||
public static Cell createLastOnRow(final Cell cell) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return new LastOnRowByteBufferedCell(((ByteBufferedCell) cell).getRowByteBuffer(),
|
||||
((ByteBufferedCell) cell).getRowPositionInByteBuffer(), cell.getRowLength());
|
||||
((ByteBufferedCell) cell).getRowPosition(), cell.getRowLength());
|
||||
}
|
||||
return new LastOnRowCell(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
|
||||
}
|
||||
|
@ -1329,11 +1329,11 @@ public final class CellUtil {
|
|||
public static Cell createLastOnRowCol(final Cell cell) {
|
||||
if (cell instanceof ByteBufferedCell) {
|
||||
return new LastOnRowColByteBufferedCell(((ByteBufferedCell) cell).getRowByteBuffer(),
|
||||
((ByteBufferedCell) cell).getRowPositionInByteBuffer(), cell.getRowLength(),
|
||||
((ByteBufferedCell) cell).getRowPosition(), cell.getRowLength(),
|
||||
((ByteBufferedCell) cell).getFamilyByteBuffer(),
|
||||
((ByteBufferedCell) cell).getFamilyPositionInByteBuffer(), cell.getFamilyLength(),
|
||||
((ByteBufferedCell) cell).getFamilyPosition(), cell.getFamilyLength(),
|
||||
((ByteBufferedCell) cell).getQualifierByteBuffer(),
|
||||
((ByteBufferedCell) cell).getQualifierPositionInByteBuffer(), cell.getQualifierLength());
|
||||
((ByteBufferedCell) cell).getQualifierPosition(), cell.getQualifierLength());
|
||||
}
|
||||
return new LastOnRowColCell(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength(),
|
||||
cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength(),
|
||||
|
@ -1534,7 +1534,7 @@ public final class CellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRowPositionInByteBuffer() {
|
||||
public int getRowPosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1544,7 +1544,7 @@ public final class CellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getFamilyPositionInByteBuffer() {
|
||||
public int getFamilyPosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1554,7 +1554,7 @@ public final class CellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getQualifierPositionInByteBuffer() {
|
||||
public int getQualifierPosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1564,7 +1564,7 @@ public final class CellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getTagsPositionInByteBuffer() {
|
||||
public int getTagsPosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1574,7 +1574,7 @@ public final class CellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getValuePositionInByteBuffer() {
|
||||
public int getValuePosition() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1635,7 +1635,7 @@ public final class CellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRowPositionInByteBuffer() {
|
||||
public int getRowPosition() {
|
||||
return this.roffset;
|
||||
}
|
||||
|
||||
|
@ -1673,7 +1673,7 @@ public final class CellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRowPositionInByteBuffer() {
|
||||
public int getRowPosition() {
|
||||
return this.roffset;
|
||||
}
|
||||
|
||||
|
@ -1720,7 +1720,7 @@ public final class CellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getFamilyPositionInByteBuffer() {
|
||||
public int getFamilyPosition() {
|
||||
return this.famOffset;
|
||||
}
|
||||
|
||||
|
@ -1735,7 +1735,7 @@ public final class CellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getQualifierPositionInByteBuffer() {
|
||||
public int getQualifierPosition() {
|
||||
return this.colOffset;
|
||||
}
|
||||
|
||||
|
@ -1947,7 +1947,7 @@ public final class CellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getFamilyPositionInByteBuffer() {
|
||||
public int getFamilyPosition() {
|
||||
return this.foffset;
|
||||
}
|
||||
|
||||
|
@ -1962,7 +1962,7 @@ public final class CellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getQualifierPositionInByteBuffer() {
|
||||
public int getQualifierPosition() {
|
||||
return this.qoffset;
|
||||
}
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ public class OffheapKeyValue extends ByteBufferedCell implements HeapSize, Clone
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRowPositionInByteBuffer() {
|
||||
public int getRowPosition() {
|
||||
return this.offset + KeyValue.ROW_KEY_OFFSET;
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ public class OffheapKeyValue extends ByteBufferedCell implements HeapSize, Clone
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getFamilyPositionInByteBuffer() {
|
||||
public int getFamilyPosition() {
|
||||
return getFamilyLengthPosition() + Bytes.SIZEOF_BYTE;
|
||||
}
|
||||
|
||||
|
@ -207,8 +207,8 @@ public class OffheapKeyValue extends ByteBufferedCell implements HeapSize, Clone
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getQualifierPositionInByteBuffer() {
|
||||
return getFamilyPositionInByteBuffer() + getFamilyLength();
|
||||
public int getQualifierPosition() {
|
||||
return getFamilyPosition() + getFamilyLength();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -217,7 +217,7 @@ public class OffheapKeyValue extends ByteBufferedCell implements HeapSize, Clone
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getValuePositionInByteBuffer() {
|
||||
public int getValuePosition() {
|
||||
return this.offset + KeyValue.ROW_OFFSET + this.keyLen;
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ public class OffheapKeyValue extends ByteBufferedCell implements HeapSize, Clone
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getTagsPositionInByteBuffer() {
|
||||
public int getTagsPosition() {
|
||||
int tagsLen = getTagsLength();
|
||||
if (tagsLen == 0) {
|
||||
return this.offset + this.length;
|
||||
|
|
|
@ -515,7 +515,7 @@ abstract class BufferedDataBlockEncoder implements DataBlockEncoder {
|
|||
|
||||
@Override
|
||||
public int getRowOffset() {
|
||||
return getRowPositionInByteBuffer();
|
||||
return getRowPosition();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -530,7 +530,7 @@ abstract class BufferedDataBlockEncoder implements DataBlockEncoder {
|
|||
|
||||
@Override
|
||||
public int getFamilyOffset() {
|
||||
return getFamilyPositionInByteBuffer();
|
||||
return getFamilyPosition();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -545,7 +545,7 @@ abstract class BufferedDataBlockEncoder implements DataBlockEncoder {
|
|||
|
||||
@Override
|
||||
public int getQualifierOffset() {
|
||||
return getQualifierPositionInByteBuffer();
|
||||
return getQualifierPosition();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -604,7 +604,7 @@ abstract class BufferedDataBlockEncoder implements DataBlockEncoder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRowPositionInByteBuffer() {
|
||||
public int getRowPosition() {
|
||||
return Bytes.SIZEOF_SHORT;
|
||||
}
|
||||
|
||||
|
@ -614,7 +614,7 @@ abstract class BufferedDataBlockEncoder implements DataBlockEncoder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getFamilyPositionInByteBuffer() {
|
||||
public int getFamilyPosition() {
|
||||
return this.familyOffset;
|
||||
}
|
||||
|
||||
|
@ -624,7 +624,7 @@ abstract class BufferedDataBlockEncoder implements DataBlockEncoder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getQualifierPositionInByteBuffer() {
|
||||
public int getQualifierPosition() {
|
||||
return this.qualifierOffset;
|
||||
}
|
||||
|
||||
|
@ -634,7 +634,7 @@ abstract class BufferedDataBlockEncoder implements DataBlockEncoder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getValuePositionInByteBuffer() {
|
||||
public int getValuePosition() {
|
||||
return this.valueOffset;
|
||||
}
|
||||
|
||||
|
@ -644,7 +644,7 @@ abstract class BufferedDataBlockEncoder implements DataBlockEncoder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getTagsPositionInByteBuffer() {
|
||||
public int getTagsPosition() {
|
||||
return this.tagsOffset;
|
||||
}
|
||||
|
||||
|
|
|
@ -529,7 +529,7 @@ public class TestCellUtil {
|
|||
|
||||
@Override
|
||||
public byte getFamilyLength() {
|
||||
return this.buffer.get(getFamilyPositionInByteBuffer() - 1);
|
||||
return this.buffer.get(getFamilyPosition() - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -612,7 +612,7 @@ public class TestCellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRowPositionInByteBuffer() {
|
||||
public int getRowPosition() {
|
||||
return this.offset + KeyValue.ROW_KEY_OFFSET;
|
||||
}
|
||||
|
||||
|
@ -622,7 +622,7 @@ public class TestCellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getFamilyPositionInByteBuffer() {
|
||||
public int getFamilyPosition() {
|
||||
return this.offset + KeyValue.ROW_KEY_OFFSET + getRowLength() + Bytes.SIZEOF_BYTE;
|
||||
}
|
||||
|
||||
|
@ -632,8 +632,8 @@ public class TestCellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getQualifierPositionInByteBuffer() {
|
||||
return getFamilyPositionInByteBuffer() + getFamilyLength();
|
||||
public int getQualifierPosition() {
|
||||
return getFamilyPosition() + getFamilyLength();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -642,7 +642,7 @@ public class TestCellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getValuePositionInByteBuffer() {
|
||||
public int getValuePosition() {
|
||||
return this.offset + KeyValue.ROW_OFFSET + getKeyLength();
|
||||
}
|
||||
|
||||
|
@ -652,7 +652,7 @@ public class TestCellUtil {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getTagsPositionInByteBuffer() {
|
||||
public int getTagsPosition() {
|
||||
int tagsLen = getTagsLength();
|
||||
if (tagsLen == 0) {
|
||||
return this.offset + this.length;
|
||||
|
|
|
@ -60,19 +60,19 @@ public class TestOffheapKeyValue {
|
|||
assertEquals(
|
||||
ROW1,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getRowByteBuffer(),
|
||||
offheapKV.getRowPositionInByteBuffer(), offheapKV.getRowLength()));
|
||||
offheapKV.getRowPosition(), offheapKV.getRowLength()));
|
||||
assertEquals(
|
||||
FAM1,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getFamilyByteBuffer(),
|
||||
offheapKV.getFamilyPositionInByteBuffer(), offheapKV.getFamilyLength()));
|
||||
offheapKV.getFamilyPosition(), offheapKV.getFamilyLength()));
|
||||
assertEquals(
|
||||
QUAL1,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getQualifierByteBuffer(),
|
||||
offheapKV.getQualifierPositionInByteBuffer(), offheapKV.getQualifierLength()));
|
||||
offheapKV.getQualifierPosition(), offheapKV.getQualifierLength()));
|
||||
assertEquals(
|
||||
ROW1,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getValueByteBuffer(),
|
||||
offheapKV.getValuePositionInByteBuffer(), offheapKV.getValueLength()));
|
||||
offheapKV.getValuePosition(), offheapKV.getValueLength()));
|
||||
assertEquals(0L, offheapKV.getTimestamp());
|
||||
assertEquals(Type.Put.getCode(), offheapKV.getTypeByte());
|
||||
|
||||
|
@ -103,11 +103,11 @@ public class TestOffheapKeyValue {
|
|||
assertEquals(
|
||||
FAM2,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getFamilyByteBuffer(),
|
||||
offheapKV.getFamilyPositionInByteBuffer(), offheapKV.getFamilyLength()));
|
||||
offheapKV.getFamilyPosition(), offheapKV.getFamilyLength()));
|
||||
assertEquals(
|
||||
QUAL2,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getQualifierByteBuffer(),
|
||||
offheapKV.getQualifierPositionInByteBuffer(), offheapKV.getQualifierLength()));
|
||||
offheapKV.getQualifierPosition(), offheapKV.getQualifierLength()));
|
||||
byte[] nullQualifier = new byte[0];
|
||||
kvCell = new KeyValue(row1, fam1, nullQualifier, 0L, Type.Put, row1);
|
||||
buf = ByteBuffer.allocateDirect(kvCell.getBuffer().length);
|
||||
|
@ -116,19 +116,19 @@ public class TestOffheapKeyValue {
|
|||
assertEquals(
|
||||
ROW1,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getRowByteBuffer(),
|
||||
offheapKV.getRowPositionInByteBuffer(), offheapKV.getRowLength()));
|
||||
offheapKV.getRowPosition(), offheapKV.getRowLength()));
|
||||
assertEquals(
|
||||
FAM1,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getFamilyByteBuffer(),
|
||||
offheapKV.getFamilyPositionInByteBuffer(), offheapKV.getFamilyLength()));
|
||||
offheapKV.getFamilyPosition(), offheapKV.getFamilyLength()));
|
||||
assertEquals(
|
||||
"",
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getQualifierByteBuffer(),
|
||||
offheapKV.getQualifierPositionInByteBuffer(), offheapKV.getQualifierLength()));
|
||||
offheapKV.getQualifierPosition(), offheapKV.getQualifierLength()));
|
||||
assertEquals(
|
||||
ROW1,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getValueByteBuffer(),
|
||||
offheapKV.getValuePositionInByteBuffer(), offheapKV.getValueLength()));
|
||||
offheapKV.getValuePosition(), offheapKV.getValueLength()));
|
||||
assertEquals(0L, offheapKV.getTimestamp());
|
||||
assertEquals(Type.Put.getCode(), offheapKV.getTypeByte());
|
||||
}
|
||||
|
@ -142,19 +142,19 @@ public class TestOffheapKeyValue {
|
|||
assertEquals(
|
||||
ROW1,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getRowByteBuffer(),
|
||||
offheapKV.getRowPositionInByteBuffer(), offheapKV.getRowLength()));
|
||||
offheapKV.getRowPosition(), offheapKV.getRowLength()));
|
||||
assertEquals(
|
||||
FAM1,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getFamilyByteBuffer(),
|
||||
offheapKV.getFamilyPositionInByteBuffer(), offheapKV.getFamilyLength()));
|
||||
offheapKV.getFamilyPosition(), offheapKV.getFamilyLength()));
|
||||
assertEquals(
|
||||
QUAL1,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getQualifierByteBuffer(),
|
||||
offheapKV.getQualifierPositionInByteBuffer(), offheapKV.getQualifierLength()));
|
||||
offheapKV.getQualifierPosition(), offheapKV.getQualifierLength()));
|
||||
assertEquals(
|
||||
ROW1,
|
||||
ByteBufferUtils.toStringBinary(offheapKV.getValueByteBuffer(),
|
||||
offheapKV.getValuePositionInByteBuffer(), offheapKV.getValueLength()));
|
||||
offheapKV.getValuePosition(), offheapKV.getValueLength()));
|
||||
assertEquals(0L, offheapKV.getTimestamp());
|
||||
assertEquals(Type.Put.getCode(), offheapKV.getTypeByte());
|
||||
// change tags to handle both onheap and offheap stuff
|
||||
|
@ -182,15 +182,15 @@ public class TestOffheapKeyValue {
|
|||
assertEquals(
|
||||
ROW1,
|
||||
ByteBufferUtils.toStringBinary(offheapKeyOnlyKV.getRowByteBuffer(),
|
||||
offheapKeyOnlyKV.getRowPositionInByteBuffer(), offheapKeyOnlyKV.getRowLength()));
|
||||
offheapKeyOnlyKV.getRowPosition(), offheapKeyOnlyKV.getRowLength()));
|
||||
assertEquals(
|
||||
FAM1,
|
||||
ByteBufferUtils.toStringBinary(offheapKeyOnlyKV.getFamilyByteBuffer(),
|
||||
offheapKeyOnlyKV.getFamilyPositionInByteBuffer(), offheapKeyOnlyKV.getFamilyLength()));
|
||||
offheapKeyOnlyKV.getFamilyPosition(), offheapKeyOnlyKV.getFamilyLength()));
|
||||
assertEquals(
|
||||
QUAL1,
|
||||
ByteBufferUtils.toStringBinary(offheapKeyOnlyKV.getQualifierByteBuffer(),
|
||||
offheapKeyOnlyKV.getQualifierPositionInByteBuffer(),
|
||||
offheapKeyOnlyKV.getQualifierPosition(),
|
||||
offheapKeyOnlyKV.getQualifierLength()));
|
||||
assertEquals(0L, offheapKeyOnlyKV.getTimestamp());
|
||||
assertEquals(Type.Put.getCode(), offheapKeyOnlyKV.getTypeByte());
|
||||
|
|
|
@ -118,7 +118,7 @@ public class PrefixTreeSeeker implements EncodedSeeker {
|
|||
return new OffheapPrefixTreeCell(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength(),
|
||||
cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength(),
|
||||
cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength(),
|
||||
cell.getValueByteBuffer(), cell.getValuePositionInByteBuffer(), cell.getValueLength(),
|
||||
cell.getValueByteBuffer(), cell.getValuePosition(), cell.getValueLength(),
|
||||
cell.getTagsArray(), cell.getTagsOffset(), cell.getTagsLength(), cell.getTimestamp(),
|
||||
cell.getTypeByte(), cell.getSequenceId());
|
||||
}
|
||||
|
@ -441,7 +441,7 @@ public class PrefixTreeSeeker implements EncodedSeeker {
|
|||
|
||||
@Override
|
||||
public int getRowOffset() {
|
||||
return getRowPositionInByteBuffer();
|
||||
return getRowPosition();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -456,7 +456,7 @@ public class PrefixTreeSeeker implements EncodedSeeker {
|
|||
|
||||
@Override
|
||||
public int getFamilyOffset() {
|
||||
return getFamilyPositionInByteBuffer();
|
||||
return getFamilyPosition();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -471,7 +471,7 @@ public class PrefixTreeSeeker implements EncodedSeeker {
|
|||
|
||||
@Override
|
||||
public int getQualifierOffset() {
|
||||
return getQualifierPositionInByteBuffer();
|
||||
return getQualifierPosition();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -518,7 +518,7 @@ public class PrefixTreeSeeker implements EncodedSeeker {
|
|||
|
||||
@Override
|
||||
public int getTagsOffset() {
|
||||
return getTagsPositionInByteBuffer();
|
||||
return getTagsPosition();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -532,7 +532,7 @@ public class PrefixTreeSeeker implements EncodedSeeker {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRowPositionInByteBuffer() {
|
||||
public int getRowPosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -542,7 +542,7 @@ public class PrefixTreeSeeker implements EncodedSeeker {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getFamilyPositionInByteBuffer() {
|
||||
public int getFamilyPosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -552,7 +552,7 @@ public class PrefixTreeSeeker implements EncodedSeeker {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getQualifierPositionInByteBuffer() {
|
||||
public int getQualifierPosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -562,7 +562,7 @@ public class PrefixTreeSeeker implements EncodedSeeker {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getTagsPositionInByteBuffer() {
|
||||
public int getTagsPosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -572,7 +572,7 @@ public class PrefixTreeSeeker implements EncodedSeeker {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getValuePositionInByteBuffer() {
|
||||
public int getValuePosition() {
|
||||
return this.valOffset;
|
||||
}
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ public class PrefixTreeCell extends ByteBufferedCell implements SettableSequence
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRowPositionInByteBuffer() {
|
||||
public int getRowPosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -274,7 +274,7 @@ public class PrefixTreeCell extends ByteBufferedCell implements SettableSequence
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getFamilyPositionInByteBuffer() {
|
||||
public int getFamilyPosition() {
|
||||
return getFamilyOffset();
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ public class PrefixTreeCell extends ByteBufferedCell implements SettableSequence
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getQualifierPositionInByteBuffer() {
|
||||
public int getQualifierPosition() {
|
||||
return getQualifierOffset();
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ public class PrefixTreeCell extends ByteBufferedCell implements SettableSequence
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getValuePositionInByteBuffer() {
|
||||
public int getValuePosition() {
|
||||
return pair.getSecond();
|
||||
}
|
||||
|
||||
|
@ -304,7 +304,7 @@ public class PrefixTreeCell extends ByteBufferedCell implements SettableSequence
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getTagsPositionInByteBuffer() {
|
||||
public int getTagsPosition() {
|
||||
return getTagsOffset();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue