寻找报错

master
Cui YongXing 2024-09-05 22:44:31 +08:00
parent 9e177fec24
commit 8551515a2f
2 changed files with 22 additions and 22 deletions

View File

@ -296,7 +296,7 @@ public class TaskInfoServiceImpl extends ServiceImpl<TaskInfoMapper, TaskInfo> i
} }
long end = System.currentTimeMillis(); long end = System.currentTimeMillis();
log.info("执行时间:{}",end-start); //log.info("执行时间:{}",end-start);
return null; return null;
} }
@ -304,18 +304,18 @@ public class TaskInfoServiceImpl extends ServiceImpl<TaskInfoMapper, TaskInfo> i
@NotNull @NotNull
private void getString(Long pageNum,String fieName,String joint,Long basicId,Long newBasicId,Long tableId,HashMap<String, String> map ,Integer num) { private void getString(Long pageNum,String fieName,String joint,Long basicId,Long newBasicId,Long tableId,HashMap<String, String> map ,Integer num) {
String sqlSelect = " SELECT " + fieName + " FROM " + joint +" limit "+pageNum +","+PAGE_SIZE; String sqlSelect = " SELECT " + fieName + " FROM " + joint +" limit "+pageNum +","+PAGE_SIZE;
log.info(sqlSelect); //log.info(sqlSelect);
log.info("执行{}查询的方法",sqlSelect); //log.info("执行{}查询的方法",sqlSelect);
Result<DataValue[][]> tableValueResult = datasourceFeign.findTableValueToArray(basicId, sqlSelect); Result<DataValue[][]> tableValueResult = datasourceFeign.findTableValueToArray(basicId, sqlSelect);
DataValue[][] data = tableValueResult.getData(); DataValue[][] data = tableValueResult.getData();
if (pageNum==160000){ // if (pageNum==160000){
for (DataValue[] datum : data) { // for (DataValue[] datum : data) {
for (DataValue dataValue : datum) { // for (DataValue dataValue : datum) {
System.out.println(dataValue); // System.out.println(dataValue);
} // }
} // }
} // }
for (DataValue[] datum : data) { for (DataValue[] datum : data) {
for (DataValue dataValue : datum) { for (DataValue dataValue : datum) {
String key = dataValue.getKey(); String key = dataValue.getKey();
@ -323,10 +323,10 @@ public class TaskInfoServiceImpl extends ServiceImpl<TaskInfoMapper, TaskInfo> i
dataValue.setKey(newKey); dataValue.setKey(newKey);
} }
} }
log.info("{}查询结束",sqlSelect); //log.info("{}查询结束",sqlSelect);
log.info("执行{}添加的方法",sqlSelect); //log.info("执行{}添加的方法",sqlSelect);
Result result = datasourceFeign.addProduct(newBasicId, tableId, data); Result result = datasourceFeign.addProduct(newBasicId, tableId, data);
log.info("{}添加结束",sqlSelect); //log.info("{}添加结束",sqlSelect);
// for (List<DataValue> dataValues : tableValue) { // for (List<DataValue> dataValues : tableValue) {
// for (DataValue dataValue : dataValues) { // for (DataValue dataValue : dataValues) {
// String key = dataValue.getKey(); // String key = dataValue.getKey();

View File

@ -57,7 +57,9 @@ public class OptimizedPrioritizedThreadPool {
emergencySemaphore.acquire(); emergencySemaphore.acquire();
executor.submit(() -> { executor.submit(() -> {
try { try {
System.out.println("Starting emergency task...");
task.run(); task.run();
System.out.println("Finished emergency task.");
} finally { } finally {
emergencySemaphore.release(); emergencySemaphore.release();
if (remainingTasks.decrementAndGet() == 0) { if (remainingTasks.decrementAndGet() == 0) {
@ -76,7 +78,9 @@ public class OptimizedPrioritizedThreadPool {
highPrioritySemaphore.acquire(); highPrioritySemaphore.acquire();
executor.submit(() -> { executor.submit(() -> {
try { try {
System.out.println("Starting high priority task...");
task.run(); task.run();
System.out.println("Finished high priority task.");
} finally { } finally {
highPrioritySemaphore.release(); highPrioritySemaphore.release();
} }
@ -92,7 +96,9 @@ public class OptimizedPrioritizedThreadPool {
mediumPrioritySemaphore.acquire(); mediumPrioritySemaphore.acquire();
executor.submit(() -> { executor.submit(() -> {
try { try {
System.out.println("Starting medium priority task...");
task.run(); task.run();
System.out.println("Finished medium priority task.");
} finally { } finally {
mediumPrioritySemaphore.release(); mediumPrioritySemaphore.release();
} }
@ -108,7 +114,9 @@ public class OptimizedPrioritizedThreadPool {
lowPrioritySemaphore.acquire(); lowPrioritySemaphore.acquire();
executor.submit(() -> { executor.submit(() -> {
try { try {
System.out.println("Starting low priority task...");
task.run(); task.run();
System.out.println("Finished low priority task.");
} finally { } finally {
lowPrioritySemaphore.release(); lowPrioritySemaphore.release();
} }
@ -159,13 +167,5 @@ public class OptimizedPrioritizedThreadPool {
} }
} }
public static void shutdown() throws InterruptedException { // 移除shutdown方法
executor.shutdown();
if (!executor.awaitTermination(1, TimeUnit.HOURS)) {
executor.shutdownNow();
if (!executor.awaitTermination(1, TimeUnit.MINUTES)) {
System.err.println("Pool did not terminate");
}
}
}
} }