寻找报错
parent
47bfaba772
commit
9cc6bd3249
|
@ -254,11 +254,7 @@ public class TaskInfoServiceImpl extends ServiceImpl<TaskInfoMapper, TaskInfo> i
|
||||||
submitHighPriorityTask(()->{
|
submitHighPriorityTask(()->{
|
||||||
getString(pageNum, finalFieName, finalJoint,basicId,newBasicId,tableId,map,num);
|
getString(pageNum, finalFieName, finalJoint,basicId,newBasicId,tableId,map,num);
|
||||||
});
|
});
|
||||||
try {
|
|
||||||
TimeUnit.MILLISECONDS.sleep(100); // 适当延迟,避免所有任务同时提交
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Weight.centre.getValue().equals(weight)){
|
if (Weight.centre.getValue().equals(weight)){
|
||||||
|
@ -312,9 +308,10 @@ public class TaskInfoServiceImpl extends ServiceImpl<TaskInfoMapper, TaskInfo> i
|
||||||
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();
|
||||||
|
log.info("执行{}查询的方法结束",sqlSelect);
|
||||||
// if (pageNum==160000){
|
// if (pageNum==160000){
|
||||||
// for (DataValue[] datum : data) {
|
// for (DataValue[] datum : data) {
|
||||||
// for (DataValue dataValue : datum) {
|
// for (DataValue dataValue : datum) {
|
||||||
|
|
|
@ -57,9 +57,7 @@ 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) {
|
||||||
|
@ -69,7 +67,6 @@ public class OptimizedPrioritizedThreadPool {
|
||||||
});
|
});
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
System.err.println("Interrupted while waiting to execute emergency task.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,16 +75,13 @@ 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();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
System.err.println("Interrupted while waiting to execute high priority task.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,16 +90,13 @@ 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();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
System.err.println("Interrupted while waiting to execute medium priority task.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,16 +105,13 @@ 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();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
System.err.println("Interrupted while waiting to execute low priority task.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue