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"; return "success";
} }
@Resource // @Resource
private MySqlDataSource mySqlDataSource; // private MySqlDataSource mySqlDataSource;
@NotNull @NotNull
private void selectAndAdd(Long databaseId, Long basicId, String sql, Long tableId, 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.setSql(sql);
mySqlQuery.setOne(finalFirstArray); mySqlQuery.setOne(finalFirstArray);
mySqlQuery.setTwo(two); mySqlQuery.setTwo(two);
mySqlDataSource.setQuery(MySqlQuery.builder().dataSourceId(basicId).sql(sql).one(finalFirstArray).two(two).build()); // mySqlDataSource.setQuery(MySqlQuery.builder().dataSourceId(basicId).sql(sql).one(finalFirstArray).two(two).build());
log.info("传过去的值是{}",mySqlDataSource.getQuery().toString()); // log.info("传过去的值是{}",mySqlDataSource.getQuery().toString());
DataValue[][] dataValues = mySqlDataSource.getRows(); // DataValue[][] dataValues = mySqlDataSource.getRows();
log.info("okl"); log.info("okl");
// Result<DataValue[][]> result = dataValueClient.findTableValueToArray(databaseId, sql, finalFirstArray, two); Result<DataValue[][]> result = dataValueClient.findTableValueToArray(databaseId, sql, finalFirstArray, two);
log.info("调用完毕拿到值"); 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); 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( 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);