/[projects]/dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Lookup.java
ViewVC logotype

Diff of /dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Lookup.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2154 by torben, Thu May 8 09:01:43 2014 UTC revision 2195 by torben, Thu Jun 19 10:56:04 2014 UTC
# Line 14  import java.util.logging.Logger; Line 14  import java.util.logging.Logger;
14  import dk.daoas.fulddaekning.BoundingBox.BoundingBoxException;  import dk.daoas.fulddaekning.BoundingBox.BoundingBoxException;
15    
16  public class Lookup {  public class Lookup {
17    
18            static final String CONFIG_FILENAME = "fulddaekning.properties";
19    
20          static int max_workers;          static int max_workers;
21          static boolean verbose;          static boolean verbose;
22                    
23          static Properties conf;          static boolean rename_tables;
24            
25            static SafeProperties conf;
26          static Logger logger = Logger.getLogger( Lookup.class.toString() );          static Logger logger = Logger.getLogger( Lookup.class.toString() );
27                    
28          int postnr;          int postnr;
# Line 155  public class Lookup { Line 160  public class Lookup {
160                    
161          public static void main(String[] args) throws Exception {          public static void main(String[] args) throws Exception {
162                                    
163                  File confFile = new File("fulddaekning.properties");                  File confFile = new File( CONFIG_FILENAME );
164                  if (! confFile.exists() ) {                  if (! confFile.exists() ) {
165                          logger.warning("Config file not found");                          logger.warning("Config file not found: " + CONFIG_FILENAME);
166                          System.exit(1);                          System.exit(1);
167                  }                  }
168                                                                    
169                  conf = new Properties();                  conf = new SafeProperties();
170                  conf.load( new FileReader(confFile) );                  conf.load( new FileReader(confFile) );
171                                    
172                  max_workers = Integer.parseInt( conf.getProperty("MAX_WORKERS") );                  max_workers = Integer.parseInt( conf.getSafeProperty("MAX_WORKERS") );
173                  logger.info("Starting with MAX_WORKERS:" + max_workers);                  logger.info("Starting with MAX_WORKERS:" + max_workers);
174                                    
175                  verbose = Boolean.parseBoolean( conf.getProperty("VERBOSE") );                  verbose = Boolean.parseBoolean( conf.getSafeProperty("VERBOSE") );
176                  logger.info("Starting with VERBOSE:" + verbose);                  logger.info("Starting with VERBOSE:" + verbose);
177                                    
178                    rename_tables = Boolean.parseBoolean( conf.getSafeProperty("RENAMETABLES") );
179                    logger.info("Starting with RENAMETABLES:" + rename_tables);
180                    
181                  Database db = new Database(conf);                  Database db = new Database(conf);
182                                    
183                  db.resetResultTable();                  db.resetResultTable();
# Line 188  public class Lookup { Line 196  public class Lookup {
196                          lookup.doLookup();                                                lookup.doLookup();                      
197                  }                  }
198                                    
199                    if (rename_tables) {
200                            db.renameResultTables();
201                    } else {
202                            logger.info( "Rename tables is disabled !!!" );
203                    }
204                    
205                  long now = System.currentTimeMillis();                  long now = System.currentTimeMillis();
206                                    
                 logger.info("Fuld load done : " + (now-start) );  
207                  logger.info("Flest Ikke-dækkede, " + flestIkkeDaekkede);                  logger.info("Flest Ikke-dækkede, " + flestIkkeDaekkede);
208                  logger.info("Flest Dækkede, " + flestDaekkede);                  logger.info("Flest Dækkede, " + flestDaekkede);
209                    logger.info("Fuld load done : " + (now-start) );
210    
211                                    
212                                    
213                  //Lookup lookup = new Lookup(7400, db);                  //Lookup lookup = new Lookup(7400, db);

Legend:
Removed from v.2154  
changed lines
  Added in v.2195

  ViewVC Help
Powered by ViewVC 1.1.20