HBASE-8678 Wrongly delete cells in some case which can not be deleted (Jean-Marc Spaggiari)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1501430 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Lars George 2013-07-09 18:25:11 +00:00
parent 60fcb122d5
commit e6665054ef
2 changed files with 17 additions and 4 deletions

View File

@ -92,9 +92,7 @@ public class RemoteHTable implements HTableInterface {
Set families = familyMap.entrySet();
if (families != null) {
Iterator i = familyMap.entrySet().iterator();
if (i.hasNext()) {
sb.append('/');
}
sb.append('/');
while (i.hasNext()) {
Map.Entry e = (Map.Entry)i.next();
Collection quals = (Collection)e.getValue();

View File

@ -298,6 +298,7 @@ public class TestRemoteTable {
assertTrue(Bytes.equals(VALUE_2, value));
}
@Test
public void testDelete() throws IOException {
Put put = new Put(ROW_3);
put.add(COLUMN_1, QUALIFIER_1, VALUE_1);
@ -329,6 +330,20 @@ public class TestRemoteTable {
assertTrue(Bytes.equals(VALUE_1, value1));
assertNull(value2);
delete = new Delete(ROW_3);
delete.setTimestamp(1L);
remoteTable.delete(delete);
get = new Get(ROW_3);
get.addFamily(COLUMN_1);
get.addFamily(COLUMN_2);
result = remoteTable.get(get);
value1 = result.getValue(COLUMN_1, QUALIFIER_1);
value2 = result.getValue(COLUMN_2, QUALIFIER_2);
assertNotNull(value1);
assertTrue(Bytes.equals(VALUE_1, value1));
assertNull(value2);
delete = new Delete(ROW_3);
remoteTable.delete(delete);
@ -339,7 +354,7 @@ public class TestRemoteTable {
value1 = result.getValue(COLUMN_1, QUALIFIER_1);
value2 = result.getValue(COLUMN_2, QUALIFIER_2);
assertNull(value1);
assertNull(value2);
assertNull(value2);
}
public void testScanner() throws IOException {