Compare commits

...

2 Commits

Author SHA1 Message Date
陈思豪 4bfcadc8ea 测试线程池 2024-09-10 16:28:37 +08:00
陈思豪 da54e9e99f 测试线程池 2024-09-10 16:28:00 +08:00
2 changed files with 8 additions and 8 deletions

View File

@ -253,8 +253,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, TaskInfo> implement
return "success";
}
@Resource
private MySqlDataSource mySqlDataSource;
// @Resource
// private MySqlDataSource mySqlDataSource;
@NotNull
private void selectAndAdd(Long databaseId, Long basicId, String sql, Long tableId,
@ -268,14 +268,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, TaskInfo> implement
mySqlQuery.setSql(sql);
mySqlQuery.setOne(finalFirstArray);
mySqlQuery.setTwo(two);
mySqlDataSource.setQuery(MySqlQuery.builder().dataSourceId(basicId).sql(sql).one(finalFirstArray).two(two).build());
log.info("传过去的值是{}",mySqlDataSource.getQuery().toString());
DataValue[][] dataValues = mySqlDataSource.getRows();
// mySqlDataSource.setQuery(MySqlQuery.builder().dataSourceId(basicId).sql(sql).one(finalFirstArray).two(two).build());
// log.info("传过去的值是{}",mySqlDataSource.getQuery().toString());
// DataValue[][] dataValues = mySqlDataSource.getRows();
log.info("okl");
// Result<DataValue[][]> result = dataValueClient.findTableValueToArray(databaseId, sql, finalFirstArray, two);
Result<DataValue[][]> result = dataValueClient.findTableValueToArray(databaseId, sql, finalFirstArray, two);
log.info("调用完毕拿到值");
// DataValue[][] dataValues = result.getData();
DataValue[][] dataValues = result.getData();
System.out.println("aaa" + dataValues.length);
System.out.println("aaa" + dataValues.length);
System.out.println("aaa" + dataValues.length);

View File

@ -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);