Search in sources :

Example 1 with DeleteResult

use of org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker.DeleteResult in project hbase by apache.

the class TestScanDeleteTracker method testDeletedByDelete.

@Test
public void testDeletedByDelete() {
    KeyValue kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), Bytes.toBytes("qualifier"), timestamp, KeyValue.Type.Delete);
    sdt.add(kv);
    DeleteResult ret = sdt.isDeleted(kv);
    assertEquals(DeleteResult.VERSION_DELETED, ret);
}
Also used : KeyValue(org.apache.hadoop.hbase.KeyValue) DeleteResult(org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker.DeleteResult) Test(org.junit.Test)

Example 2 with DeleteResult

use of org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker.DeleteResult in project hbase by apache.

the class TestScanDeleteTracker method testDeleteColumnDelete.

@Test
public void testDeleteColumnDelete() {
    byte[] qualifier = Bytes.toBytes("qualifier");
    KeyValue kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier, timestamp, KeyValue.Type.DeleteColumn);
    sdt.add(kv);
    qualifier = Bytes.toBytes("qualifier1");
    kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier, timestamp, KeyValue.Type.Delete);
    sdt.add(kv);
    DeleteResult ret = sdt.isDeleted(kv);
    assertEquals(DeleteResult.VERSION_DELETED, ret);
}
Also used : KeyValue(org.apache.hadoop.hbase.KeyValue) DeleteResult(org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker.DeleteResult) Test(org.junit.Test)

Example 3 with DeleteResult

use of org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker.DeleteResult in project hbase by apache.

the class TestScanDeleteTracker method testDeletedByDeleteColumn.

@Test
public void testDeletedByDeleteColumn() {
    KeyValue kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), Bytes.toBytes("qualifier"), timestamp, KeyValue.Type.DeleteColumn);
    sdt.add(kv);
    timestamp -= 5;
    kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), Bytes.toBytes("qualifier"), timestamp, KeyValue.Type.DeleteColumn);
    DeleteResult ret = sdt.isDeleted(kv);
    assertEquals(DeleteResult.COLUMN_DELETED, ret);
}
Also used : KeyValue(org.apache.hadoop.hbase.KeyValue) DeleteResult(org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker.DeleteResult) Test(org.junit.Test)

Example 4 with DeleteResult

use of org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker.DeleteResult in project hbase by apache.

the class TestScanDeleteTracker method testDeletedByDeleteFamily.

@Test
public void testDeletedByDeleteFamily() {
    KeyValue kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), Bytes.toBytes("qualifier"), timestamp, KeyValue.Type.DeleteFamily);
    sdt.add(kv);
    timestamp -= 5;
    kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), Bytes.toBytes("qualifier"), timestamp, KeyValue.Type.DeleteColumn);
    DeleteResult ret = sdt.isDeleted(kv);
    assertEquals(DeleteResult.FAMILY_DELETED, ret);
}
Also used : KeyValue(org.apache.hadoop.hbase.KeyValue) DeleteResult(org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker.DeleteResult) Test(org.junit.Test)

Example 5 with DeleteResult

use of org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker.DeleteResult in project hbase by apache.

the class TestScanDeleteTracker method testDeletedByDeleteFamilyVersion.

@Test
public void testDeletedByDeleteFamilyVersion() {
    byte[] qualifier1 = Bytes.toBytes("qualifier1");
    byte[] qualifier2 = Bytes.toBytes("qualifier2");
    byte[] qualifier3 = Bytes.toBytes("qualifier3");
    byte[] qualifier4 = Bytes.toBytes("qualifier4");
    KeyValue kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), null, timestamp, KeyValue.Type.DeleteFamilyVersion);
    sdt.add(kv);
    kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier1, timestamp, KeyValue.Type.DeleteFamilyVersion);
    DeleteResult ret = sdt.isDeleted(kv);
    assertEquals(DeleteResult.FAMILY_VERSION_DELETED, ret);
    kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier2, timestamp, KeyValue.Type.DeleteFamilyVersion);
    ret = sdt.isDeleted(kv);
    assertEquals(DeleteResult.FAMILY_VERSION_DELETED, ret);
    kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier3, timestamp, KeyValue.Type.DeleteFamilyVersion);
    ret = sdt.isDeleted(kv);
    assertEquals(DeleteResult.FAMILY_VERSION_DELETED, ret);
    kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier4, timestamp, KeyValue.Type.DeleteFamilyVersion);
    ret = sdt.isDeleted(kv);
    assertEquals(DeleteResult.FAMILY_VERSION_DELETED, ret);
    kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier1, timestamp + 3, KeyValue.Type.DeleteFamilyVersion);
    ret = sdt.isDeleted(kv);
    assertEquals(DeleteResult.NOT_DELETED, ret);
    kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier2, timestamp - 2, KeyValue.Type.DeleteFamilyVersion);
    ret = sdt.isDeleted(kv);
    assertEquals(DeleteResult.NOT_DELETED, ret);
    kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier3, timestamp - 5, KeyValue.Type.DeleteFamilyVersion);
    ret = sdt.isDeleted(kv);
    assertEquals(DeleteResult.NOT_DELETED, ret);
    kv = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier4, timestamp + 8, KeyValue.Type.DeleteFamilyVersion);
    ret = sdt.isDeleted(kv);
    assertEquals(DeleteResult.NOT_DELETED, ret);
}
Also used : KeyValue(org.apache.hadoop.hbase.KeyValue) DeleteResult(org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker.DeleteResult) Test(org.junit.Test)

Aggregations

DeleteResult (org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker.DeleteResult)8 KeyValue (org.apache.hadoop.hbase.KeyValue)7 Test (org.junit.Test)7 ReturnCode (org.apache.hadoop.hbase.filter.Filter.ReturnCode)1