|
@@ -316,8 +316,10 @@ public class YyskAddressStandardizationServiceImpl {
|
|
|
long startTime = System.currentTimeMillis();
|
|
|
int taskId = sort * i + startFileIndex;
|
|
|
// 任务执行
|
|
|
- startMutilExecutor(taskId, fileRootPath + "ziranren\\yysk_dmdz_address_standardization_10000_" + taskId + ".xlsx",
|
|
|
- fileRootPath + "ziranrenOutput\\yysk_dmdz_address_standardization_10000_" + taskId + ".xlsx");
|
|
|
+ startMutilExecutor(taskId, fileRootPath + "datas\\yysk_dmdz_address_standardization_200000_" + taskId + ".xlsx",
|
|
|
+ fileRootPath + "output\\yysk_dmdz_address_standardization_200000_" + taskId + ".xlsx");
|
|
|
+ /*startMutilExecutor(taskId, fileRootPath + "ziranren\\yysk_dmdz_address_standardization_10000_" + taskId + ".xlsx",
|
|
|
+ fileRootPath + "ziranrenOutput\\yysk_dmdz_address_standardization_10000_" + taskId + ".xlsx");*/
|
|
|
long endTime = System.currentTimeMillis();
|
|
|
ScheduledTasks.taskRunStatus = false;
|
|
|
System.out.println("单个文件处理完成!用时" + (endTime - startTime) / 1000 + "秒!");
|
|
@@ -354,7 +356,9 @@ public class YyskAddressStandardizationServiceImpl {
|
|
|
|
|
|
public List<YyskAddressStandardization> runExecutorService(List<YyskAddressStandardization> listData) {
|
|
|
// 创建线程池
|
|
|
- ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() / 2);
|
|
|
+ int executorSize = Runtime.getRuntime().availableProcessors() - 2;
|
|
|
+ System.out.println("创建线程池个数:" + executorSize);
|
|
|
+ ExecutorService executorService = Executors.newFixedThreadPool(executorSize);
|
|
|
List<Future<?>> futures = new ArrayList<>();
|
|
|
for (int i = 0; i < listData.size(); i++) {
|
|
|
YyskAddressStandardization item = listData.get(i);
|