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