1 8 9 package com.sleepycat.je.recovery; 10 11 import java.util.Hashtable ; 12 13 import com.sleepycat.je.CheckpointConfig; 14 import com.sleepycat.je.DatabaseException; 15 import com.sleepycat.je.Transaction; 16 import com.sleepycat.je.config.EnvironmentParams; 17 18 public class RecoveryDeleteTest extends RecoveryTestBase { 19 20 protected void setExtraProperties() 21 throws DatabaseException { 22 envConfig.setConfigParam( 23 EnvironmentParams.ENV_RUN_INCOMPRESSOR.getName(), 24 "false"); 25 } 26 27 28 public void testDeleteAllAndCompress() 29 throws Throwable { 30 31 createEnvAndDbs(1 << 20, false, NUM_DBS); 32 int numRecs = 10; 33 34 try { 35 Hashtable expectedData = new Hashtable (); 37 38 Transaction txn = env.beginTransaction(null, null); 40 insertData(txn, 0, numRecs -1 , expectedData, 1, true, NUM_DBS); 41 txn.commit(); 42 43 47 CheckpointConfig ckptConfig = new CheckpointConfig(); 48 ckptConfig.setForce(true); 49 env.checkpoint(ckptConfig); 50 env.checkpoint(ckptConfig); 51 txn = env.beginTransaction(null, null); 52 insertData(txn, numRecs, numRecs + 1, expectedData, 1, true, NUM_DBS); 53 txn.commit(); 54 55 56 txn = env.beginTransaction(null, null); 57 deleteData(txn, expectedData, true, true, NUM_DBS); 58 txn.commit(); 59 60 61 env.compress(); 62 63 closeEnv(); 64 recoverAndVerify(expectedData, NUM_DBS); 65 } catch (Throwable t) { 66 t.printStackTrace(); 68 throw t; 69 } 70 } 71 } 72 | Popular Tags |