23 |
|
|
24 |
|
|
25 |
public class AfstandAndenRuteTask extends Task { |
public class AfstandAndenRuteTask extends Task { |
26 |
|
|
27 |
|
|
28 |
private TaskLogger logger = TaskLogger.getInstance(); |
private TaskLogger logger = TaskLogger.getInstance(); |
29 |
|
|
30 |
final static boolean VERBOSE = false;// |
final static boolean VERBOSE = false;// |
31 |
|
|
32 |
|
public final static String INCREMENTAL = "INCREMENTAL"; |
33 |
|
public final static String FULL = "FULL"; |
34 |
|
|
35 |
|
|
36 |
static boolean test_mode; |
static boolean test_mode; |
46 |
ThreadPoolExecutor threadPool; |
ThreadPoolExecutor threadPool; |
47 |
|
|
48 |
boolean isIncremental; |
boolean isIncremental; |
|
String type; |
|
49 |
|
|
50 |
|
|
51 |
public AfstandAndenRuteTask(String distributor, String type) { |
public AfstandAndenRuteTask(String distributor, String type) { |
52 |
this.distributor = distributor; |
this.distributor = distributor; |
|
this.type = type; |
|
53 |
|
|
54 |
type = type.toUpperCase(); |
type = type.toUpperCase(); |
55 |
switch(type) { |
switch(type) { |
56 |
case "FULL": |
case FULL: |
57 |
isIncremental = false; |
isIncremental = false; |
58 |
break; |
break; |
59 |
case "INCREMENTAL": |
case INCREMENTAL: |
60 |
isIncremental = true; |
isIncremental = true; |
61 |
break; |
break; |
62 |
default: |
default: |
92 |
|
|
93 |
|
|
94 |
try (Connection conn = DBConnection.getConnection() ) { |
try (Connection conn = DBConnection.getConnection() ) { |
95 |
Database db = new Database(conn, isIncremental); |
DatabaseRouteDistance db = new DatabaseRouteDistance(conn, isIncremental); |
96 |
|
|
97 |
db.prepareIncrementalSearch(); |
db.prepareIncrementalSearch(); |
98 |
|
|
181 |
|
|
182 |
|
|
183 |
|
|
184 |
} else { |
} /*else { |
185 |
/// Test |
/// Test |
186 |
/* |
|
187 |
db.resetResultTable(); |
db.resetResultTable(); |
188 |
|
|
189 |
|
|
192 |
|
|
193 |
short post = (short) 2700; |
short post = (short) 2700; |
194 |
Lookup lookup = new Lookup(post, db, threadPool); |
Lookup lookup = new Lookup(post, db, threadPool); |
195 |
lookup.doLookup();*/ |
lookup.doLookup(); |
196 |
} |
} */ |
197 |
|
|
198 |
|
|
199 |
long now = System.currentTimeMillis(); |
long now = System.currentTimeMillis(); |
208 |
logger.info("Heraf, antal fundne : " + antalFundne ); |
logger.info("Heraf, antal fundne : " + antalFundne ); |
209 |
|
|
210 |
logger.info( String.format("Fandt adresser til : %.2f %%", (antalFundne.get() *100.0)/antalIkkeDaekkede ) ); |
logger.info( String.format("Fandt adresser til : %.2f %%", (antalFundne.get() *100.0)/antalIkkeDaekkede ) ); |
|
//logger.info("Fandt adresser til : " + (antalFundne*100.0)/ikkeDaekkede.length + "%" ); |
|
|
|
|
211 |
} |
} |
212 |
} |
} |
213 |
|
|