-
Notifications
You must be signed in to change notification settings - Fork 506
Open
Description
@Override
public List<Point> recordHandlePoints(List<ImportDataStep> steps) {
System.out.println("多线程查询======== start");
List<Point> points = new ArrayList<>();
for (ImportDataStep step : steps) {
Future<List<Point>> future = executorService.submit(new HighImportDataPointFuture(step, pointLogic));
try {
points.addAll(future.get());
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
}
System.out.println("多线程查询======== point " + points.size() + " 条数==============");
return points;
}
位于 HighImportDataServiceImpl 实现错误了吧,future.get()会阻塞线程 所以实际上是串行提交,没有线程并行
future.get()应该在任务提交之外的循环遍历获取吧
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels