85 |
max_workers = 1; |
max_workers = 1; |
86 |
} |
} |
87 |
logger.info("Starting with MAX_WORKERS:" + max_workers); |
logger.info("Starting with MAX_WORKERS:" + max_workers); |
88 |
setupThreadPool(max_workers); |
|
89 |
|
threadPool = Executors.newFixedThreadPool(max_workers, new WorkerThreadFactory() ); |
90 |
|
|
91 |
logger.info("Starting with INCREMENTAL:" + isIncremental); |
logger.info("Starting with INCREMENTAL:" + isIncremental); |
92 |
|
|
121 |
// END OF MAIN run |
// END OF MAIN run |
122 |
|
|
123 |
threadPool.shutdown(); //Calc is done now |
threadPool.shutdown(); //Calc is done now |
124 |
|
threadPool = null;//release early for GC |
125 |
|
|
126 |
|
|
127 |
manager.submitTask( new ReloadTask("AfstandAndenRute/" + distributor) ); |
manager.submitTask( new ReloadTask("AfstandAndenRute/" + distributor) ); |
237 |
return String.format("%02d:%02d:%02d.%03d", hours, minutes, seconds, mseconds); |
return String.format("%02d:%02d:%02d.%03d", hours, minutes, seconds, mseconds); |
238 |
} |
} |
239 |
|
|
|
private void setupThreadPool(int max_workers) { |
|
|
threadPool = Executors.newFixedThreadPool(max_workers, new WorkerThreadFactory() ); |
|
|
} |
|
240 |
|
|
241 |
static class WorkerThreadFactory implements ThreadFactory { |
static class WorkerThreadFactory implements ThreadFactory { |
242 |
int count = 0; |
int count = 0; |