HBASE-1847 Delete latest of a null qualifier when non-null qualifiers exist throws a RuntimeException
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@816024 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b59e375a5c
commit
e50c404aca
|
@ -30,6 +30,8 @@ Release 0.21.0 - Unreleased
|
||||||
HBASE-818 HFile code review and refinement (Schubert Zhang via Stack)
|
HBASE-818 HFile code review and refinement (Schubert Zhang via Stack)
|
||||||
HBASE-1830 HbaseObjectWritable methods should allow null HBCs
|
HBASE-1830 HbaseObjectWritable methods should allow null HBCs
|
||||||
for when Writable is not Configurable (Stack via jgray)
|
for when Writable is not Configurable (Stack via jgray)
|
||||||
|
HBASE-1847 Delete latest of a null qualifier when non-null qualifiers
|
||||||
|
exist throws a RuntimeException
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
HBASE-1760 Cleanup TODOs in HTable
|
HBASE-1760 Cleanup TODOs in HTable
|
||||||
|
|
|
@ -1160,7 +1160,8 @@ public class HRegion implements HConstants, HeapSize { // , Writable{
|
||||||
NavigableSet<byte []> qualifiers =
|
NavigableSet<byte []> qualifiers =
|
||||||
new TreeSet<byte []>(Bytes.BYTES_COMPARATOR);
|
new TreeSet<byte []>(Bytes.BYTES_COMPARATOR);
|
||||||
byte [] q = kv.getQualifier();
|
byte [] q = kv.getQualifier();
|
||||||
if (q != null && q.length > 0) qualifiers.add(kv.getQualifier());
|
if(q == null) q = HConstants.EMPTY_BYTE_ARRAY;
|
||||||
|
qualifiers.add(q);
|
||||||
get(store, g, qualifiers, result);
|
get(store, g, qualifiers, result);
|
||||||
if (result.isEmpty()) {
|
if (result.isEmpty()) {
|
||||||
// Nothing to delete
|
// Nothing to delete
|
||||||
|
|
|
@ -1070,7 +1070,7 @@ public class TestClient extends HBaseClusterTestCase {
|
||||||
result.size() == 9);
|
result.size() == 9);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDeletes() throws Exception {
|
public void testDeletes() throws Exception {
|
||||||
byte [] TABLE = Bytes.toBytes("testDeletes");
|
byte [] TABLE = Bytes.toBytes("testDeletes");
|
||||||
|
|
||||||
|
@ -1113,6 +1113,9 @@ public class TestClient extends HBaseClusterTestCase {
|
||||||
put.add(FAMILIES[0], QUALIFIER, ts[4], VALUES[4]);
|
put.add(FAMILIES[0], QUALIFIER, ts[4], VALUES[4]);
|
||||||
put.add(FAMILIES[0], QUALIFIER, ts[2], VALUES[2]);
|
put.add(FAMILIES[0], QUALIFIER, ts[2], VALUES[2]);
|
||||||
put.add(FAMILIES[0], QUALIFIER, ts[3], VALUES[3]);
|
put.add(FAMILIES[0], QUALIFIER, ts[3], VALUES[3]);
|
||||||
|
put.add(FAMILIES[0], null, ts[4], VALUES[4]);
|
||||||
|
put.add(FAMILIES[0], null, ts[2], VALUES[2]);
|
||||||
|
put.add(FAMILIES[0], null, ts[3], VALUES[3]);
|
||||||
ht.put(put);
|
ht.put(put);
|
||||||
|
|
||||||
delete = new Delete(ROW);
|
delete = new Delete(ROW);
|
||||||
|
@ -1120,7 +1123,7 @@ public class TestClient extends HBaseClusterTestCase {
|
||||||
ht.delete(delete);
|
ht.delete(delete);
|
||||||
|
|
||||||
get = new Get(ROW);
|
get = new Get(ROW);
|
||||||
get.addFamily(FAMILIES[0]);
|
get.addColumn(FAMILIES[0], QUALIFIER);
|
||||||
get.setMaxVersions(Integer.MAX_VALUE);
|
get.setMaxVersions(Integer.MAX_VALUE);
|
||||||
result = ht.get(get);
|
result = ht.get(get);
|
||||||
assertNResult(result, ROW, FAMILIES[0], QUALIFIER,
|
assertNResult(result, ROW, FAMILIES[0], QUALIFIER,
|
||||||
|
@ -1129,7 +1132,7 @@ public class TestClient extends HBaseClusterTestCase {
|
||||||
0, 2);
|
0, 2);
|
||||||
|
|
||||||
scan = new Scan(ROW);
|
scan = new Scan(ROW);
|
||||||
scan.addFamily(FAMILIES[0]);
|
scan.addColumn(FAMILIES[0], QUALIFIER);
|
||||||
scan.setMaxVersions(Integer.MAX_VALUE);
|
scan.setMaxVersions(Integer.MAX_VALUE);
|
||||||
result = getSingleScanResult(ht, scan);
|
result = getSingleScanResult(ht, scan);
|
||||||
assertNResult(result, ROW, FAMILIES[0], QUALIFIER,
|
assertNResult(result, ROW, FAMILIES[0], QUALIFIER,
|
||||||
|
@ -1137,6 +1140,16 @@ public class TestClient extends HBaseClusterTestCase {
|
||||||
new byte[][] {VALUES[1], VALUES[2], VALUES[3]},
|
new byte[][] {VALUES[1], VALUES[2], VALUES[3]},
|
||||||
0, 2);
|
0, 2);
|
||||||
|
|
||||||
|
// Test for HBASE-1847
|
||||||
|
delete = new Delete(ROW);
|
||||||
|
delete.deleteColumn(FAMILIES[0], null);
|
||||||
|
ht.delete(delete);
|
||||||
|
|
||||||
|
// Cleanup null qualifier
|
||||||
|
delete = new Delete(ROW);
|
||||||
|
delete.deleteColumns(FAMILIES[0], null);
|
||||||
|
ht.delete(delete);
|
||||||
|
|
||||||
// Expected client behavior might be that you can re-put deleted values
|
// Expected client behavior might be that you can re-put deleted values
|
||||||
// But alas, this is not to be. We can't put them back in either case.
|
// But alas, this is not to be. We can't put them back in either case.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue