|
@@ -354,13 +354,13 @@ public class YyskAddressStandardizationServiceImpl {
|
|
|
|
|
|
public List<YyskAddressStandardization> runExecutorService(List<YyskAddressStandardization> listData) {
|
|
|
// 创建线程池
|
|
|
- ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
|
|
+ ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() / 2);
|
|
|
List<Future<?>> futures = new ArrayList<>();
|
|
|
for (int i = 0; i < listData.size(); i++) {
|
|
|
YyskAddressStandardization item = listData.get(i);
|
|
|
-// int finalI = i;
|
|
|
+ int finalI = i;
|
|
|
futures.add(executorService.submit(() -> {
|
|
|
-// System.out.print("<-" + finalI + "->");
|
|
|
+ System.out.print("<-" + finalI + "->");
|
|
|
List<String> addrList = new ArrayList<>();
|
|
|
String[] addr = AddressMatcher.matchProvinceAndCity(item.getAddress());
|
|
|
if (addr != null && !addr[0].contains("上海")) {
|