zhongjiajie commented on code in PR #15528:
URL: 
https://github.com/apache/dolphinscheduler/pull/15528#discussion_r1472951603


##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/repository/impl/TaskGroupDaoImpl.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.dao.repository.impl;
+
+import org.apache.dolphinscheduler.dao.entity.TaskGroup;
+import org.apache.dolphinscheduler.dao.mapper.TaskGroupMapper;
+import org.apache.dolphinscheduler.dao.repository.BaseDao;
+import org.apache.dolphinscheduler.dao.repository.TaskGroupDao;
+
+import java.util.List;
+
+import lombok.NonNull;
+import lombok.extern.slf4j.Slf4j;
+
+import org.springframework.stereotype.Repository;
+
+@Slf4j
+@Repository
+public class TaskGroupDaoImpl extends BaseDao<TaskGroup, TaskGroupMapper> 
implements TaskGroupDao {
+
+    public TaskGroupDaoImpl(@NonNull TaskGroupMapper taskGroupMapper) {
+        super(taskGroupMapper);
+    }
+
+    @Override
+    public List<TaskGroup> queryAllTaskGroups() {
+        return mybatisMapper.selectList(null);
+    }
+
+    @Override
+    public List<TaskGroup> queryUsedTaskGroups() {
+        return mybatisMapper.queryUsedTaskGroups();
+    }
+
+    @Override
+    public List<TaskGroup> queryAvailableTaskGroups() {
+        return mybatisMapper.queryAvailableTaskGroups();
+    }
+
+    @Override
+    public boolean acquireTaskGroupSlot(Integer taskGroupId) {
+        if (taskGroupId == null) {
+            throw new IllegalArgumentException("taskGroupId cannot be null");
+        }

Review Comment:
   is there any reason we do not use `@NonNull` directly for parameter 
`taskGroupId`?



##########
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/mysql/dolphinscheduler_ddl.sql:
##########
@@ -80,4 +80,19 @@ ALTER TABLE `t_ds_process_definition_log` MODIFY COLUMN 
`version` int NOT NULL D
 ALTER TABLE `t_ds_process_instance` MODIFY COLUMN `process_definition_version` 
int NOT NULL DEFAULT 1 COMMENT "process definition version";
 ALTER TABLE `t_ds_task_definition` MODIFY COLUMN `version` int NOT NULL 
DEFAULT 1 COMMENT "task definition version";
 ALTER TABLE `t_ds_task_definition_log` MODIFY COLUMN `version` int NOT NULL 
DEFAULT 1 COMMENT "task definition version";
-ALTER TABLE `t_ds_task_instance` MODIFY COLUMN `task_definition_version` int 
NOT NULL DEFAULT 1 COMMENT "task definition version";
\ No newline at end of file
+ALTER TABLE `t_ds_task_instance` MODIFY COLUMN `task_definition_version` int 
NOT NULL DEFAULT 1 COMMENT "task definition version";
+
+-- create idx_t_ds_task_group_queue_in_queue on t_ds_task_group_queue
+DROP PROCEDURE IF EXISTS create_idx_t_ds_task_group_queue_in_queue;
+delimiter d//
+CREATE PROCEDURE create_idx_t_ds_task_group_queue_in_queue()
+BEGIN
+    DECLARE index_exists INT DEFAULT 0;
+    SELECT COUNT(*) INTO index_exists FROM information_schema.statistics WHERE 
table_schema = (SELECT DATABASE()) AND  table_name = 't_ds_task_group_queue' 
AND index_name = 'idx_t_ds_task_group_queue_in_queue';
+    IF index_exists = 0 THEN CREATE INDEX idx_t_ds_task_group_queue_in_queue 
ON t_ds_task_group_queue(in_queue);
+END IF;
+END;
+d//
+delimiter ;
+CALL create_idx_t_ds_task_group_queue_in_queue;
+DROP PROCEDURE create_idx_t_ds_task_group_queue_in_queue;

Review Comment:
   I think we could directly remove the related 3.3.0 upgrade. I would merge 
almost all upgrade sql from 3.3.0 to 3.2.1. and we will not release 3.3.0 until 
we close or nearly close 3.2.x



-- 
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]

Reply via email to