--- dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Lookup.java 2014/05/08 09:01:43 2154 +++ dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Lookup.java 2014/06/19 10:56:04 2195 @@ -14,10 +14,15 @@ import dk.daoas.fulddaekning.BoundingBox.BoundingBoxException; public class Lookup { + + static final String CONFIG_FILENAME = "fulddaekning.properties"; + static int max_workers; static boolean verbose; - static Properties conf; + static boolean rename_tables; + + static SafeProperties conf; static Logger logger = Logger.getLogger( Lookup.class.toString() ); int postnr; @@ -155,21 +160,24 @@ public static void main(String[] args) throws Exception { - File confFile = new File("fulddaekning.properties"); + File confFile = new File( CONFIG_FILENAME ); if (! confFile.exists() ) { - logger.warning("Config file not found"); + logger.warning("Config file not found: " + CONFIG_FILENAME); System.exit(1); } - conf = new Properties(); + conf = new SafeProperties(); conf.load( new FileReader(confFile) ); - max_workers = Integer.parseInt( conf.getProperty("MAX_WORKERS") ); + max_workers = Integer.parseInt( conf.getSafeProperty("MAX_WORKERS") ); logger.info("Starting with MAX_WORKERS:" + max_workers); - verbose = Boolean.parseBoolean( conf.getProperty("VERBOSE") ); + verbose = Boolean.parseBoolean( conf.getSafeProperty("VERBOSE") ); logger.info("Starting with VERBOSE:" + verbose); + rename_tables = Boolean.parseBoolean( conf.getSafeProperty("RENAMETABLES") ); + logger.info("Starting with RENAMETABLES:" + rename_tables); + Database db = new Database(conf); db.resetResultTable(); @@ -188,11 +196,18 @@ lookup.doLookup(); } + if (rename_tables) { + db.renameResultTables(); + } else { + logger.info( "Rename tables is disabled !!!" ); + } + long now = System.currentTimeMillis(); - - logger.info("Fuld load done : " + (now-start) ); + logger.info("Flest Ikke-dækkede, " + flestIkkeDaekkede); logger.info("Flest Dækkede, " + flestDaekkede); + logger.info("Fuld load done : " + (now-start) ); + //Lookup lookup = new Lookup(7400, db);