public void testDelete_KeepVersionZero() { byte[] qualifier = Bytes.toBytes("qualifier"); deleteType = KeyValue.Type.Delete.getCode(); long deleteTimestamp = 10; long valueTimestamp = 0; sdt.reset(); KeyValue kv = new KeyValue( Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier, deleteTimestamp, KeyValue.Type.Delete); sdt.add(kv); kv = new KeyValue( Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier, valueTimestamp, KeyValue.Type.Delete); DeleteResult ret = sdt.isDeleted(kv); assertEquals(DeleteResult.NOT_DELETED, ret); }
public void testDelete_DeleteColumn() { byte[] qualifier = Bytes.toBytes("qualifier"); deleteType = KeyValue.Type.Delete.getCode(); KeyValue kv = new KeyValue( Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier, timestamp, KeyValue.Type.Delete); sdt.add(kv); timestamp -= 5; kv = new KeyValue( Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier, timestamp, KeyValue.Type.DeleteColumn); deleteType = KeyValue.Type.DeleteColumn.getCode(); sdt.add(kv); timestamp -= 5; kv = new KeyValue( Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier, timestamp, KeyValue.Type.DeleteColumn); DeleteResult ret = sdt.isDeleted(kv); assertEquals(DeleteResult.COLUMN_DELETED, ret); }
// Testing new way where we save the Delete in case of a Delete for specific // ts, could have just added the last line to the first test, but rather keep // them separated public void testDelete_KeepDelete() { byte[] qualifier = Bytes.toBytes("qualifier"); deleteType = KeyValue.Type.Delete.getCode(); KeyValue kv = new KeyValue( Bytes.toBytes("row"), Bytes.toBytes("f"), qualifier, timestamp, KeyValue.Type.Delete); sdt.add(kv); sdt.isDeleted(kv); assertEquals(false, sdt.isEmpty()); }