7 |
import java.util.Queue; |
import java.util.Queue; |
8 |
import java.util.Set; |
import java.util.Set; |
9 |
import java.util.concurrent.CyclicBarrier; |
import java.util.concurrent.CyclicBarrier; |
10 |
|
import java.util.concurrent.ExecutorService; |
11 |
import java.util.concurrent.Executors; |
import java.util.concurrent.Executors; |
12 |
import java.util.concurrent.ThreadFactory; |
import java.util.concurrent.ThreadFactory; |
|
import java.util.concurrent.ThreadPoolExecutor; |
|
13 |
import java.util.concurrent.atomic.AtomicInteger; |
import java.util.concurrent.atomic.AtomicInteger; |
14 |
|
|
15 |
import ags.utils.dataStructures.trees.thirdGenKD.KdTree; |
import ags.utils.dataStructures.trees.thirdGenKD.KdTree; |
16 |
import dk.daoas.adressevedligehold.ReloadHelper; |
import dk.daoas.adressevedligehold.ReloadTask; |
17 |
import dk.daoas.adressevedligehold.ServiceConfig; |
import dk.daoas.adressevedligehold.ServiceConfig; |
18 |
import dk.daoas.adressevedligehold.beans.Address; |
import dk.daoas.adressevedligehold.beans.Address; |
19 |
import dk.daoas.adressevedligehold.db.DBConnection; |
import dk.daoas.adressevedligehold.db.DBConnection; |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
ThreadPoolExecutor threadPool; |
ExecutorService threadPool; |
47 |
|
|
48 |
boolean isIncremental; |
boolean isIncremental; |
49 |
|
|
122 |
threadPool.shutdown(); //Calc is done now |
threadPool.shutdown(); //Calc is done now |
123 |
|
|
124 |
|
|
125 |
|
manager.submitTask( new ReloadTask("AfstandAndenRute/" + distributor) ); |
126 |
|
|
127 |
|
|
128 |
long now = System.currentTimeMillis(); |
long now = System.currentTimeMillis(); |
129 |
long elapsed = now - start ; |
long elapsed = now - start ; |
214 |
db.saveBatch(); |
db.saveBatch(); |
215 |
|
|
216 |
if (test_mode == false && this.isAborted() == false) { |
if (test_mode == false && this.isAborted() == false) { |
217 |
db.renameResultTables(); |
db.renameResultTables(); |
|
|
|
|
ReloadHelper.triggerReload( "AfstandAndenRute/" + distributor ); |
|
218 |
|
|
219 |
|
|
220 |
} else { |
} else { |
236 |
} |
} |
237 |
|
|
238 |
private void setupThreadPool(int max_workers) { |
private void setupThreadPool(int max_workers) { |
239 |
threadPool = (ThreadPoolExecutor) Executors.newFixedThreadPool(max_workers, new WorkerThreadFactory() ); |
threadPool = Executors.newFixedThreadPool(max_workers, new WorkerThreadFactory() ); |
240 |
} |
} |
241 |
|
|
242 |
static class WorkerThreadFactory implements ThreadFactory { |
static class WorkerThreadFactory implements ThreadFactory { |