Index: src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestDeleteAfterScan.java =================================================================== --- src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestDeleteAfterScan.java (revision 0) +++ src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestDeleteAfterScan.java (revision 0) @@ -0,0 +1,51 @@ +/* + * $Id$ Created on Jan 7, 2008 + */ +package org.apache.hadoop.hbase; + +import java.io.IOException; +import java.util.SortedMap; + +import junit.framework.Assert; + +import org.apache.hadoop.io.Text; + +public class TestDeleteAfterScan extends HBaseTestCase { + + private final String tableName = "TEST_TABLE"; + private final Text colName = new Text("C:col"); + + public void testDeleteAfterScann() throws IOException { + HBaseAdmin admin = new HBaseAdmin(conf); + + HTableDescriptor tblDesc = new HTableDescriptor(tableName); + tblDesc.addFamily(new HColumnDescriptor("C:")); + admin.createTable(tblDesc); + + HTable table = new HTable(conf, new Text(tableName)); + Text row = new Text("1"); + + // Write a row. + long lockId = table.startUpdate(row); + table.put(lockId, colName, "hello".getBytes()); + table.commit(lockId); + + // Get the row. + SortedMap map = table.getRow(row); + Assert.assertTrue(map.size() == 1); + + // Open and immediately close a scanner + HScannerInterface scanner = table.obtainScanner(new Text[] { + colName + }, HConstants.EMPTY_START_ROW); + scanner.close(); + + // Delete the row + table.deleteAll(row); + + // Now try and read it. + map = table.getRow(row); + Assert.assertTrue(map.size() == 0); + // FAILURE here + } +} Property changes on: src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestDeleteAfterScan.java ___________________________________________________________________ Name: svn:keywords + Revision Date Id