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

Diff of /dao/FuldDaekningWorker/src/main/java/dk/daoas/fulddaekning/LookupMain.java

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

revision 2711 by torben, Sun Sep 27 19:43:24 2015 UTC revision 2717 by torben, Sun Sep 27 20:18:23 2015 UTC
# Line 60  public class LookupMain { Line 60  public class LookupMain {
60                          System.exit(1);                          System.exit(1);
61                  }                  }
62    
63                    int antalIkkeDaekkede = -1;
64                    
65                  conf = new SafeProperties();                  conf = new SafeProperties();
66                  conf.load( new FileReader(confFile) );                  conf.load( new FileReader(confFile) );
67    
# Line 78  public class LookupMain { Line 80  public class LookupMain {
80                  Constants.init(distributor);                  Constants.init(distributor);
81                  Constants consts = Constants.getInstance();                  Constants consts = Constants.getInstance();
82    
                 Database db = new Database(conf);  
                 Queue<Adresse> ikkeDaekkede = db.hentAlleIkkedaekkedeAdresser(consts.getMinPostnr(), consts.getMaxPostnr() );  
                 logger.info("Antal ikke-daekkede: " + ikkeDaekkede.size() );  
   
   
83                  max_workers = Integer.parseInt( conf.getSafeProperty("MAX_WORKERS") );                    max_workers = Integer.parseInt( conf.getSafeProperty("MAX_WORKERS") );  
84                  if (max_workers <= 0) {                    if (max_workers <= 0) {  
85                          logger.info("!!! AUTO-DETECT MAX_WORKERS !!!");                            logger.info("!!! AUTO-DETECT MAX_WORKERS !!!");  
# Line 95  public class LookupMain { Line 92  public class LookupMain {
92                  logger.info("Starting with MAX_WORKERS:" + max_workers);                          logger.info("Starting with MAX_WORKERS:" + max_workers);        
93                  setupThreadPool();                  setupThreadPool();
94    
95                    
96                    Database db = new Database(conf);
97                    Queue<Adresse> ikkeDaekkede = db.hentAlleIkkedaekkedeAdresser(consts.getMinPostnr(), consts.getMaxPostnr() );
98                    antalIkkeDaekkede = ikkeDaekkede.size();
99                    logger.info("Antal ikke-daekkede: " + antalIkkeDaekkede );
100    
101    
102    
103                  boolean testRun= false;                  boolean testRun= false;
104    
105                  AtomicInteger antalFundne = new AtomicInteger(0);                  AtomicInteger antalFundne = new AtomicInteger(0);
# Line 152  public class LookupMain { Line 157  public class LookupMain {
157                          }                          }
158                                                    
159                          barrier.await(); // Afvent at workerne bliver færdige                          barrier.await(); // Afvent at workerne bliver færdige
160                            
161                            threadPool.shutdown(); //Calc is done now
162    
163    
164                          db.saveBatch();                          db.saveBatch();
# Line 187  public class LookupMain { Line 194  public class LookupMain {
194                  logger.info("Fuld load done : " + formatMilliSeconds(elapsed) );                  logger.info("Fuld load done : " + formatMilliSeconds(elapsed) );
195                  logger.info("Fuld load done (beregning) : " + formatMilliSeconds(elapsedBeregn) );                  logger.info("Fuld load done (beregning) : " + formatMilliSeconds(elapsedBeregn) );
196                  logger.info("Antal daekkede : " + antalDaekkedeAdresser );                  logger.info("Antal daekkede : " + antalDaekkedeAdresser );
197                  logger.info("Antal ikke-daekkede : " + ikkeDaekkede.size() );                  logger.info("Antal ikke-daekkede : " + antalIkkeDaekkede );
198                  logger.info("Heraf, antal fundne : " + antalFundne );                  logger.info("Heraf, antal fundne : " + antalFundne );
199    
200                  logger.info( String.format("Fandt adresser til : %.2f %%", (antalFundne.get() *100.0)/ikkeDaekkede.size() ) );                  logger.info( String.format("Fandt adresser til : %.2f %%", (antalFundne.get() *100.0)/antalIkkeDaekkede ) );
201                  //logger.info("Fandt adresser til : " + (antalFundne*100.0)/ikkeDaekkede.length + "%" );                  //logger.info("Fandt adresser til : " + (antalFundne*100.0)/ikkeDaekkede.length + "%" );
202          }          }
203    

Legend:
Removed from v.2711  
changed lines
  Added in v.2717

  ViewVC Help
Powered by ViewVC 1.1.20