测试线程池
parent
290ea49a65
commit
070b52c7a3
|
@ -194,7 +194,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, TaskInfo> implement
|
|||
log.info("开始查询!!!!!!!!!!!!!!!");
|
||||
Integer count = dataValueClient.findCount(Long.valueOf(taskOutputInfo.getBasicId()), sqlCount);
|
||||
log.info("查询到的条数为{}", count);
|
||||
int pageSize = 10000;
|
||||
int pageSize = 20000;
|
||||
int totalSegments = (int) Math.ceil((double) count / pageSize);
|
||||
log.info("总共页码为{}", totalSegments);
|
||||
//查询数据
|
||||
|
@ -203,7 +203,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, TaskInfo> implement
|
|||
log.info("当前页为{}", i);
|
||||
int pageNum = i * pageSize;
|
||||
long finalFirstArray = Math.min(pageSize, count - pageNum);
|
||||
String limit = " limit " + pageNum + "," + pageSize;
|
||||
String limit = " limit " + pageSize + " OFFSET " + pageNum;
|
||||
String limitSelect = sql + limit;
|
||||
Long finalDatabaseId = databaseId;
|
||||
log.info("执行查询语句为{}", limitSelect);
|
||||
|
|
|
@ -221,7 +221,7 @@ public class PriorityThreadPool {
|
|||
// 创建固定大小的线程池
|
||||
executor = new ThreadPoolExecutor(
|
||||
totalThreads, totalThreads,
|
||||
40L, TimeUnit.SECONDS,
|
||||
60L, TimeUnit.SECONDS,
|
||||
new LinkedBlockingQueue<Runnable>()
|
||||
);
|
||||
highPrioritySemaphore = new Semaphore(defaultHighThreads);
|
||||
|
|
Loading…
Reference in New Issue