Henry2SS commented on code in PR #8824:
URL: https://github.com/apache/incubator-doris/pull/8824#discussion_r844651567
##########
fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadManager.java:
##########
@@ -410,36 +411,39 @@ public long getMinTaskBeId(String clusterName) throws
LoadException {
// check if the specified BE is available for running task
// return true if it is available. return false if otherwise.
// throw exception if unrecoverable errors happen.
- public long getAvailableBeForTask(long previoudBeId, String clusterName)
throws LoadException {
+ public long getAvailableBeForTask(long previousBeId, String clusterName)
throws LoadException {
List<Long> beIdsInCluster =
Catalog.getCurrentSystemInfo().getClusterBackendIds(clusterName, true);
if (beIdsInCluster == null) {
throw new LoadException("The " + clusterName + " has been
deleted");
}
- if (previoudBeId != -1L && !beIdsInCluster.contains(previoudBeId)) {
- return -1L;
- }
-
// check if be has idle slot
readLock();
try {
Map<Long, Integer> beIdToConcurrentTasks =
getBeCurrentTasksNumMap();
+
// 1. Find if the given BE id has available slots
- if (previoudBeId != -1L) {
- int idleTaskNum = 0;
- if (!beIdToMaxConcurrentTasks.containsKey(previoudBeId)) {
- idleTaskNum = 0;
- } else if (beIdToConcurrentTasks.containsKey(previoudBeId)) {
- idleTaskNum = beIdToMaxConcurrentTasks.get(previoudBeId) -
beIdToConcurrentTasks.get(previoudBeId);
- } else {
- idleTaskNum = Config.max_routine_load_task_num_per_be;
- }
- if (idleTaskNum > 0) {
- return previoudBeId;
+ if (previousBeId != -1L) {
+ // get the previousBackend info
+ Backend previousBackend =
Catalog.getCurrentSystemInfo().getBackend(previousBeId);
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]