HBASE-2340 Add end-to-end test of sync/flush (forward-port from 0.20 branch of difference)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@944753 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-05-16 01:58:44 +00:00
parent 05980e26b8
commit ef0421d856
2 changed files with 15 additions and 16 deletions

View File

@ -582,6 +582,9 @@ Release 0.21.0 - Unreleased
HBASE-2523 Add check for licenses before rolling an RC, add to
how-to-release doc. and check for inlining a tool that does
this for us
HBASE-2234 HBASE-2234 Roll Hlog if any datanode in the write pipeline dies
(Nicolas Spiegelberg via Stack)
HBASE-2340 Add end-to-end test of sync/flush (Forward-port from branch)
NEW FEATURES

View File

@ -39,15 +39,22 @@ public class TestFullLogReconstruction {
private final static byte[] TABLE_NAME = Bytes.toBytes("tabletest");
private final static byte[] FAMILY = Bytes.toBytes("family");
private Configuration conf;
/**
/**
* @throws java.lang.Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
TEST_UTIL.getConfiguration().
setInt("hbase.regionserver.flushlogentries", 1);
Configuration c = TEST_UTIL.getConfiguration();
c.setInt("hbase.regionserver.flushlogentries", 1);
c.setBoolean("dfs.support.append", true);
// quicker heartbeat interval for faster DN death notification
c.setInt("heartbeat.recheck.interval", 5000);
c.setInt("dfs.heartbeat.interval", 1);
c.setInt("dfs.socket.timeout", 5000);
// faster failover with cluster.shutdown();fs.close() idiom
c.setInt("ipc.client.connect.max.retries", 1);
c.setInt("dfs.client.block.recovery.retries", 1);
c.setInt("hbase.regionserver.flushlogentries", 1);
TEST_UTIL.startMiniCluster(2);
}
@ -64,8 +71,6 @@ public class TestFullLogReconstruction {
*/
@Before
public void setUp() throws Exception {
conf = TEST_UTIL.getConfiguration();
}
/**
@ -105,24 +110,15 @@ public class TestFullLogReconstruction {
for(int i = 0; i < 4; i++) {
TEST_UTIL.loadTable(table, FAMILY);
if(i == 2) {
TEST_UTIL.flush();
}
}
TEST_UTIL.expireRegionServerSession(0);
scan = new Scan();
results = table.getScanner(scan);
int newCount = 0;
for (Result res : results) {
newCount++;
}
assertEquals(count, newCount);
}
}