HBASE-1518 Delete Trackers using compareRow, should just use raw binary comparator
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@784503 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3fcb6f3e69
commit
8f41f8593f
|
@ -169,6 +169,8 @@ Release 0.20.0 - Unreleased
|
|||
HBASE-1491 ZooKeeper errors: "Client has seen zxid 0xe our last zxid is 0xd"
|
||||
HBASE-1499 Fix javadoc warnings after HBASE-1304 commit (Lars George via Stack)
|
||||
HBASE-1504 Remove left-over debug from 1304 commit
|
||||
HBASE-1518 Delete Trackers using compareRow, should just use raw
|
||||
binary comparator (Jon Gray via Stack)
|
||||
|
||||
IMPROVEMENTS
|
||||
HBASE-1089 Add count of regions on filesystem to master UI; add percentage
|
||||
|
|
|
@ -45,15 +45,11 @@ public class GetDeleteTracker implements DeleteTracker {
|
|||
private Iterator<Delete> iterator;
|
||||
private Delete delete = null;
|
||||
|
||||
private KeyValue.KeyComparator comparator;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param comparator
|
||||
*/
|
||||
public GetDeleteTracker(KeyValue.KeyComparator comparator) {
|
||||
this.comparator = comparator;
|
||||
}
|
||||
public GetDeleteTracker() {}
|
||||
|
||||
/**
|
||||
* Add the specified KeyValue to the list of deletes to check against for
|
||||
|
@ -105,7 +101,7 @@ public class GetDeleteTracker implements DeleteTracker {
|
|||
}
|
||||
|
||||
// Check column
|
||||
int ret = comparator.compareRows(buffer, qualifierOffset, qualifierLength,
|
||||
int ret = Bytes.compareTo(buffer, qualifierOffset, qualifierLength,
|
||||
this.delete.buffer, this.delete.qualifierOffset,
|
||||
this.delete.qualifierLength);
|
||||
if(ret <= -1) {
|
||||
|
|
|
@ -130,7 +130,7 @@ public class QueryMatcher {
|
|||
this.tr = get.getTimeRange();
|
||||
this.oldestStamp = System.currentTimeMillis() - ttl;
|
||||
this.rowComparator = rowComparator;
|
||||
this.deletes = new GetDeleteTracker(rowComparator);
|
||||
this.deletes = new GetDeleteTracker();
|
||||
this.startKey = KeyValue.createFirstOnRow(row);
|
||||
// Single branch to deal with two types of Gets (columns vs all in family)
|
||||
if(columns == null || columns.size() == 0) {
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
package org.apache.hadoop.hbase.regionserver;
|
||||
|
||||
import org.apache.hadoop.hbase.KeyValue;
|
||||
import org.apache.hadoop.hbase.util.Bytes;
|
||||
|
||||
/**
|
||||
* This class is responsible for the tracking and enforcement of Deletes
|
||||
|
@ -78,7 +79,7 @@ public class ScanDeleteTracker implements DeleteTracker {
|
|||
|
||||
if(deleteBuffer != null && type < deleteType) {
|
||||
// same column, so ignore less specific delete
|
||||
if(comparator.compareRows(deleteBuffer, deleteOffset, deleteLength,
|
||||
if(Bytes.compareTo(deleteBuffer, deleteOffset, deleteLength,
|
||||
buffer, qualifierOffset, qualifierLength) == 0){
|
||||
return;
|
||||
}
|
||||
|
@ -112,7 +113,7 @@ public class ScanDeleteTracker implements DeleteTracker {
|
|||
|
||||
if(deleteBuffer != null) {
|
||||
// TODO ryan use a specific comparator
|
||||
int ret = comparator.compareRows(deleteBuffer, deleteOffset, deleteLength,
|
||||
int ret = Bytes.compareTo(deleteBuffer, deleteOffset, deleteLength,
|
||||
buffer, qualifierOffset, qualifierLength);
|
||||
|
||||
if(ret == 0) {
|
||||
|
|
|
@ -68,7 +68,7 @@ public class TestGetDeleteTracker extends HBaseTestCase implements HConstants {
|
|||
private byte delFam = KeyValue.Type.DeleteFamily.getCode();
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
dt = new GetDeleteTracker(KeyValue.KEY_COMPARATOR);
|
||||
dt = new GetDeleteTracker();
|
||||
col1 = "col".getBytes();
|
||||
col2 = "col2".getBytes();
|
||||
col1Len = col1.length;
|
||||
|
|
Loading…
Reference in New Issue