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

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

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

revision 2259 by torben, Mon Feb 9 13:21:39 2015 UTC revision 2263 by torben, Tue Feb 10 16:27:15 2015 UTC
# Line 34  public class LookupMain { Line 34  public class LookupMain {
34          static ThreadPoolExecutor threadPool;          static ThreadPoolExecutor threadPool;
35    
36          private static void setupThreadPool() {          private static void setupThreadPool() {
37                  threadPool = (ThreadPoolExecutor) Executors.newFixedThreadPool(max_workers, new ThreadFactory() {                  threadPool = (ThreadPoolExecutor) Executors.newFixedThreadPool(max_workers, new WorkerThreadFactory() );
                         @Override  
                         public Thread newThread(Runnable r) {  
                                 return new Thread(r, "lookupWorker");  
                         }        
                 });  
38          }          }
39                    
40                    
# Line 90  public class LookupMain { Line 85  public class LookupMain {
85                  Constants consts = Constants.getInstance();                  Constants consts = Constants.getInstance();
86                                    
87                  Database db = new Database(conf);                  Database db = new Database(conf);
                   
                   
88    
89                                    
90                  boolean testRun= false;                  boolean testRun= false;
# Line 111  public class LookupMain { Line 104  public class LookupMain {
104                                  bbox.validateBbox();                                  bbox.validateBbox();
105                          }                          }
106                                                    
107                          if (consts.doExtendedLookup()) {  
108                                  logger.info("Henter alle daekkede adresser");                          logger.info("Henter alle daekkede adresser");
109                                  alleDaekkedeAdresser = db.hentAlleDaekkedeAdresser();                          alleDaekkedeAdresser = db.hentAlleDaekkedeAdresser();
110                                  logger.info( "AlleDaekkedeAdresser.length=" + alleDaekkedeAdresser.length);                          logger.info( "AlleDaekkedeAdresser.length=" + alleDaekkedeAdresser.length);                    
                         }  
                           
111                                                    
112                          //pre-check er ok - reset tmp tabel og start søgningen                          //pre-check er ok - reset tmp tabel og start søgningen
113                          db.resetResultTable();                          db.resetResultTable();
# Line 146  public class LookupMain { Line 137  public class LookupMain {
137                          Lookup lookup = new Lookup("458x", db, threadPool);                          Lookup lookup = new Lookup("458x", db, threadPool);
138                          lookup.doLookup();                                                                                        lookup.doLookup();                                                              
139                  }                  }
140    
141                    threadPool.shutdown();
142                                    
143                  long now = System.currentTimeMillis();                  long now = System.currentTimeMillis();
144                  long elapsed = now - start ;                  long elapsed = now - start ;
# Line 182  public class LookupMain { Line 175  public class LookupMain {
175                  int hours   = (int) ((milliseconds / (1000*60*60)) % 24);                  int hours   = (int) ((milliseconds / (1000*60*60)) % 24);
176                                    
177                  return String.format("%02d:%02d:%02d.%03d", hours, minutes, seconds, mseconds);                  return String.format("%02d:%02d:%02d.%03d", hours, minutes, seconds, mseconds);
178          }                }
179            
180            static class WorkerThreadFactory implements ThreadFactory {
181                    int count = 0;
182    
183                    @Override
184                    public Thread newThread(Runnable r) {
185                            return new Thread(r, "lookupWorker/" + count++);
186                    }      
187            }
188  }  }

Legend:
Removed from v.2259  
changed lines
  Added in v.2263

  ViewVC Help
Powered by ViewVC 1.1.20