HBASE-8814 Possible NPE in split if a region has empty store files; ADDENDUM

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1499801 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2013-07-04 16:31:10 +00:00
parent 3631ba5022
commit eed3a47343
1 changed files with 8 additions and 2 deletions

View File

@ -442,7 +442,6 @@ public class TestSplitTransactionOnCluster {
HColumnDescriptor hcd = new HColumnDescriptor("col"); HColumnDescriptor hcd = new HColumnDescriptor("col");
htd.addFamily(hcd); htd.addFamily(hcd);
admin.createTable(htd); admin.createTable(htd);
ZKAssign.blockUntilNoRIT(zkw);
HTable table = new HTable(conf, userTableName); HTable table = new HTable(conf, userTableName);
try { try {
for (int i = 0; i <= 5; i++) { for (int i = 0; i <= 5; i++) {
@ -678,12 +677,14 @@ public class TestSplitTransactionOnCluster {
@Test(timeout = 60000) @Test(timeout = 60000)
public void testTableExistsIfTheSpecifiedTableRegionIsSplitParent() throws Exception { public void testTableExistsIfTheSpecifiedTableRegionIsSplitParent() throws Exception {
ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(TESTING_UTIL);
final byte[] tableName = final byte[] tableName =
Bytes.toBytes("testTableExistsIfTheSpecifiedTableRegionIsSplitParent"); Bytes.toBytes("testTableExistsIfTheSpecifiedTableRegionIsSplitParent");
// Create table then get the single region for our new table. // Create table then get the single region for our new table.
HTable t = createTableAndWait(tableName, Bytes.toBytes("cf")); HTable t = createTableAndWait(tableName, Bytes.toBytes("cf"));
List<HRegion> regions = null;
try { try {
List<HRegion> regions = cluster.getRegions(tableName); regions = cluster.getRegions(tableName);
int regionServerIndex = cluster.getServerWith(regions.get(0).getRegionName()); int regionServerIndex = cluster.getServerWith(regions.get(0).getRegionName());
HRegionServer regionServer = cluster.getRegionServer(regionServerIndex); HRegionServer regionServer = cluster.getRegionServer(regionServerIndex);
insertData(tableName, admin, t); insertData(tableName, admin, t);
@ -707,6 +708,11 @@ public class TestSplitTransactionOnCluster {
Bytes.toString(tableName)); Bytes.toString(tableName));
assertEquals("The specified table should present.", true, tableExists); assertEquals("The specified table should present.", true, tableExists);
} finally { } finally {
if (regions != null) {
String node = ZKAssign.getNodeName(zkw, regions.get(0).getRegionInfo()
.getEncodedName());
ZKUtil.deleteNodeFailSilent(zkw, node);
}
admin.setBalancerRunning(true, false); admin.setBalancerRunning(true, false);
cluster.getMaster().setCatalogJanitorEnabled(true); cluster.getMaster().setCatalogJanitorEnabled(true);
t.close(); t.close();