1 8 9 package com.sleepycat.je.logversion; 10 11 import java.io.File ; 12 import java.util.logging.Level ; 13 14 import com.sleepycat.je.EnvironmentConfig; 15 import com.sleepycat.je.Environment; 16 import com.sleepycat.je.config.EnvironmentParams; 17 import com.sleepycat.je.util.TestUtils; 18 19 35 public class MakeLogHeaderVersionData { 36 37 private MakeLogHeaderVersionData() { 38 } 39 40 public static void main(String [] args) 41 throws Exception { 42 43 if (args.length != 1) { 44 throw new Exception ("Home directory arg is required."); 45 } 46 47 File homeDir = new File (args[0]); 48 File logFile = new File (homeDir, TestUtils.LOG_FILE_NAME); 49 50 if (logFile.exists()) { 51 throw new Exception ("Home directory must be empty of log files."); 52 } 53 54 EnvironmentConfig envConfig = TestUtils.initEnvConfig(); 55 envConfig.setAllowCreate(true); 56 envConfig.setTransactional(true); 57 58 envConfig.setConfigParam 59 (EnvironmentParams.JE_LOGGING_LEVEL.getName(), 60 Level.OFF.getName()); 61 envConfig.setConfigParam 62 (EnvironmentParams.ENV_RUN_INCOMPRESSOR.getName(), "false"); 63 envConfig.setConfigParam 64 (EnvironmentParams.ENV_RUN_CLEANER.getName(), "false"); 65 envConfig.setConfigParam 66 (EnvironmentParams.ENV_RUN_EVICTOR.getName(), "false"); 67 envConfig.setConfigParam 68 (EnvironmentParams.ENV_RUN_CHECKPOINTER.getName(), "false"); 69 70 Environment env = new Environment(homeDir, envConfig); 71 env.close(); 72 73 if (!logFile.exists()) { 74 throw new Exception ("Home directory does not contain: " + logFile); 75 } 76 77 System.out.println("Sucessfully created: " + logFile); 78 } 79 } 80 | Popular Tags |