Skip to content

Commit f80a62e

Browse files
authored
[Improvement-18056] Clean up unused methods and classes in the dolphinschudler-dao module (#18153)
1 parent 4c348ed commit f80a62e

44 files changed

Lines changed: 9 additions & 705 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/DependentWorkflowDefinition.java

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@
1717

1818
package org.apache.dolphinscheduler.dao.entity;
1919

20-
import org.apache.dolphinscheduler.common.enums.CycleEnum;
21-
import org.apache.dolphinscheduler.common.utils.JSONUtils;
22-
import org.apache.dolphinscheduler.plugin.task.api.model.DependentItem;
23-
import org.apache.dolphinscheduler.plugin.task.api.model.DependentTaskModel;
24-
import org.apache.dolphinscheduler.plugin.task.api.parameters.DependentParameters;
25-
26-
import java.util.List;
27-
2820
import lombok.Data;
2921

3022
@Data
@@ -40,46 +32,4 @@ public class DependentWorkflowDefinition {
4032

4133
private String workerGroup;
4234

43-
public CycleEnum getDependentCycle(long upstreamProcessDefinitionCode) {
44-
DependentParameters dependentParameters = this.getDependentParameters();
45-
List<DependentTaskModel> dependentTaskModelList = dependentParameters.getDependence().getDependTaskList();
46-
47-
for (DependentTaskModel dependentTaskModel : dependentTaskModelList) {
48-
List<DependentItem> dependentItemList = dependentTaskModel.getDependItemList();
49-
for (DependentItem dependentItem : dependentItemList) {
50-
if (upstreamProcessDefinitionCode == dependentItem.getDefinitionCode()) {
51-
return cycle2CycleEnum(dependentItem.getCycle());
52-
}
53-
}
54-
}
55-
56-
return CycleEnum.DAY;
57-
}
58-
59-
public CycleEnum cycle2CycleEnum(String cycle) {
60-
CycleEnum cycleEnum = null;
61-
62-
switch (cycle) {
63-
case "day":
64-
cycleEnum = CycleEnum.DAY;
65-
break;
66-
case "hour":
67-
cycleEnum = CycleEnum.HOUR;
68-
break;
69-
case "week":
70-
cycleEnum = CycleEnum.WEEK;
71-
break;
72-
case "month":
73-
cycleEnum = CycleEnum.MONTH;
74-
break;
75-
default:
76-
break;
77-
}
78-
return cycleEnum;
79-
}
80-
81-
public DependentParameters getDependentParameters() {
82-
return JSONUtils.parseObject(taskParams, DependentParameters.class);
83-
}
84-
8535
}

dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/AlertGroupMapper.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,6 @@ IPage<AlertGroup> queryAlertGroupPage(Page page,
8181
*/
8282
String queryAlertGroupInstanceIdsById(@Param("alertGroupId") int alertGroupId);
8383

84-
/**
85-
* list authorized AlertGroup
86-
* @param userId
87-
* @param alertGroupsIds
88-
* @return
89-
*/
90-
<T> List<AlertGroup> listAuthorizedAlertGroupList(@Param("userId") int userId,
91-
@Param("alertGroupsIds") List<Integer> alertGroupsIds);
92-
9384
/**
9485
* queryAlertGroupPageByIds
9586
* @param page

dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/DataSourceMapper.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,6 @@ IPage<DataSource> selectPaging(IPage<DataSource> page,
9090
<T> List<DataSource> listAuthorizedDataSource(@Param("userId") int userId,
9191
@Param("dataSourceIds") T[] dataSourceIds);
9292

93-
/**
94-
* query datasource by name and user id
95-
*
96-
* @param userId userId
97-
* @param name datasource name
98-
* @return If the name does not exist or the user does not have permission, it will return null
99-
*/
100-
DataSource queryDataSourceByNameAndUserId(@Param("userId") int userId, @Param("name") String name);
101-
10293
/**
10394
* selectPagingByIds
10495
* @param dataSourcePage

dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/K8sNamespaceMapper.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ IPage<K8sNamespace> queryK8sNamespacePaging(IPage<K8sNamespace> page,
5050
*/
5151
Boolean existNamespace(@Param("namespace") String namespace, @Param("clusterCode") Long clusterCode);
5252

53-
/**
54-
* query namespace except userId
55-
*
56-
* @param userId userId
57-
* @return namespace list
58-
*/
59-
List<K8sNamespace> queryNamespaceExceptUserId(@Param("userId") int userId);
60-
6153
/**
6254
* query authed namespace list by userId
6355
*
@@ -66,11 +58,4 @@ IPage<K8sNamespace> queryK8sNamespacePaging(IPage<K8sNamespace> page,
6658
*/
6759
List<K8sNamespace> queryAuthedNamespaceListByUserId(@Param("userId") Integer userId);
6860

69-
/**
70-
* check the target namespace
71-
*
72-
* @param namespaceCode namespaceCode
73-
* @return true if exist else return null
74-
*/
75-
K8sNamespace queryByNamespaceCode(@Param("clusterCode") Long namespaceCode);
7661
}

dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/K8sNamespaceUserMapper.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,4 @@ public interface K8sNamespaceUserMapper extends BaseMapper<K8sNamespaceUser> {
3838
int deleteNamespaceRelation(@Param("namespaceId") int namespaceId,
3939
@Param("userId") int userId);
4040

41-
/**
42-
* query namespace relation
43-
*
44-
* @param namespaceId namespaceId
45-
* @param userId userId
46-
* @return namespace user relation
47-
*/
48-
K8sNamespaceUser queryNamespaceRelation(@Param("namespaceId") int namespaceId,
49-
@Param("userId") int userId);
5041
}

dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProjectMapper.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,6 @@ public interface ProjectMapper extends BaseMapper<Project> {
5252
*/
5353
Project queryDetailById(@Param("projectId") int projectId);
5454

55-
/**
56-
* query project detail by code
57-
* @param projectCode projectCode
58-
* @return project
59-
*/
60-
Project queryDetailByCode(@Param("projectCode") long projectCode);
61-
6255
/**
6356
* query project by name
6457
* @param projectName projectName
@@ -91,13 +84,6 @@ IPage<Project> queryProjectListPaging(IPage<Project> page,
9184
*/
9285
List<Project> queryAuthedProjectListByUserId(@Param("userId") int userId);
9386

94-
/**
95-
* query relation project list by userId
96-
* @param userId userId
97-
* @return project list
98-
*/
99-
List<Project> queryRelationProjectListByUserId(@Param("userId") int userId);
100-
10187
/**
10288
* query project except userId
10389
* @param userId userId
@@ -130,7 +116,6 @@ IPage<Project> queryProjectListPaging(IPage<Project> page,
130116
* list authorized Projects
131117
* @param userId
132118
* @param projectsIds
133-
* @param <T>
134119
* @return
135120
*/
136121
List<Project> listAuthorizedProjects(@Param("userId") int userId, @Param("projectsIds") List<Integer> projectsIds);
@@ -148,10 +133,4 @@ IPage<Project> queryProjectListPaging(IPage<Project> page,
148133
*/
149134
Project queryProjectByTaskInstanceId(@Param("taskInstanceId") int taskInstanceId);
150135

151-
/**
152-
* query all workflow count
153-
* @param projectsCodes projectsCodes
154-
* @return workflow count
155-
*/
156-
int queryAllWorkflowCounts(@Param("projectsCodes") List<Long> projectsCodes);
157136
}

dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/RelationSubWorkflowMapper.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,4 @@ public interface RelationSubWorkflowMapper extends BaseMapper<RelationSubWorkflo
3232
List<RelationSubWorkflow> queryAllSubWorkflowInstance(@Param("parentWorkflowInstanceId") Long parentWorkflowInstanceId,
3333
@Param("parentTaskCode") Long parentTaskCode);
3434

35-
RelationSubWorkflow queryParentWorkflowInstance(@Param("subWorkflowInstanceId") Long subWorkflowInstanceId);
36-
3735
}

dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,6 @@ IPage<Schedule> queryByProjectAndWorkflowDefinitionCodePaging(IPage<Schedule> pa
6969
@Param("workflowDefinitionCode") long workflowDefinitionCode,
7070
@Param("searchVal") String searchVal);
7171

72-
/**
73-
* Filter schedule
74-
*
75-
* @param page page
76-
* @param schedule schedule
77-
* @return schedule IPage
78-
*/
79-
IPage<Schedule> filterSchedules(IPage<Schedule> page,
80-
@Param("schedule") Schedule schedule);
81-
8272
/**
8373
* query schedule list by project name
8474
*

dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionMapper.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
2121
import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
22-
import org.apache.dolphinscheduler.dao.entity.TaskMainInfo;
2322
import org.apache.dolphinscheduler.dao.model.WorkflowDefinitionCountDto;
2423

2524
import org.apache.ibatis.annotations.Param;
@@ -28,7 +27,6 @@
2827
import java.util.List;
2928

3029
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
31-
import com.baomidou.mybatisplus.core.metadata.IPage;
3230

3331
public interface TaskDefinitionMapper extends BaseMapper<TaskDefinition> {
3432

@@ -84,15 +82,6 @@ TaskDefinition queryByName(@Param("projectCode") long projectCode,
8482
*/
8583
int batchInsert(@Param("taskDefinitions") List<TaskDefinitionLog> taskDefinitions);
8684

87-
/**
88-
* task main info
89-
* @param projectCode project code
90-
* @param codeList code list
91-
* @return task main info
92-
*/
93-
List<TaskMainInfo> queryDefineListByCodeList(@Param("projectCode") long projectCode,
94-
@Param("codeList") List<Long> codeList);
95-
9685
/**
9786
* query task definition by code list
9887
*
@@ -101,16 +90,6 @@ List<TaskMainInfo> queryDefineListByCodeList(@Param("projectCode") long projectC
10190
*/
10291
List<TaskDefinition> queryByCodeList(@Param("codes") Collection<Long> codes);
10392

104-
/**
105-
* Filter task definition
106-
*
107-
* @param page page
108-
* @param taskDefinition task definition
109-
* @return task definition IPage
110-
*/
111-
IPage<TaskDefinition> filterTaskDefinition(IPage<TaskDefinition> page,
112-
@Param("task") TaskDefinition taskDefinition);
113-
11493
/**
11594
* batch delete task by task code
11695
*

dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskGroupQueueMapper.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,6 @@
3636
*/
3737
public interface TaskGroupQueueMapper extends BaseMapper<TaskGroupQueue> {
3838

39-
/**
40-
* select task group queues by some conditions
41-
*
42-
* @param page page
43-
* @param groupId group id
44-
* @return task group queue list
45-
*/
46-
IPage<TaskGroupQueue> queryTaskGroupQueuePaging(IPage<TaskGroupQueue> page,
47-
@Param("groupId") int groupId);
48-
49-
TaskGroupQueue queryByTaskId(@Param("taskId") int taskId);
50-
5139
/**
5240
* query by status
5341
*
@@ -73,24 +61,6 @@ IPage<TaskGroupQueue> queryTaskGroupQueuePaging(IPage<TaskGroupQueue> page,
7361
*/
7462
int updateStatusByTaskId(@Param("taskId") int taskId, @Param("status") int status);
7563

76-
/**
77-
* Query the {@link TaskGroupQueue}, who's priority > the given <code>priority</code>
78-
*/
79-
List<TaskGroupQueue> queryHighPriorityTasks(@Param("groupId") int groupId, @Param("priority") int priority,
80-
@Param("status") int status);
81-
82-
TaskGroupQueue queryTheHighestPriorityTasks(@Param("groupId") int groupId, @Param("status") int status,
83-
@Param("forceStart") int forceStart, @Param("inQueue") int inQueue);
84-
85-
void updateInQueue(@Param("inQueue") int inQueue, @Param("id") int id);
86-
87-
void updateForceStart(@Param("queueId") int queueId, @Param("forceStart") int forceStart);
88-
89-
int updateInQueueLimit1(@Param("oldValue") int oldValue, @Param("newValue") int newValue, @Param("groupId") int id,
90-
@Param("status") int status);
91-
92-
int updateInQueueCAS(@Param("oldValue") int oldValue, @Param("newValue") int newValue, @Param("id") int id);
93-
9464
void modifyPriority(@Param("queueId") int queueId, @Param("priority") int priority);
9565

9666
IPage<TaskGroupQueue> queryTaskGroupQueueByTaskGroupIdPaging(Page<TaskGroupQueue> page,
@@ -100,17 +70,12 @@ IPage<TaskGroupQueue> queryTaskGroupQueueByTaskGroupIdPaging(Page<TaskGroupQueue
10070
@Param("groupId") int groupId,
10171
@Param("projects") List<Project> projects);
10272

103-
void deleteByTaskInstanceIds(@Param("taskInstanceIds") List<Integer> taskInstanceIds);
104-
10573
void deleteByWorkflowInstanceId(@Param("workflowInstanceId") Integer workflowInstanceId);
10674

10775
void deleteByWorkflowInstanceIds(@Param("workflowInstanceIds") List<Integer> workflowInstanceIds);
10876

10977
void deleteByTaskGroupIds(@Param("taskGroupIds") List<Integer> taskGroupIds);
11078

111-
void updateTaskGroupPriorityByTaskInstanceId(@Param("taskInstanceId") Integer taskInstanceId,
112-
@Param("priority") int taskGroupPriority);
113-
11479
List<TaskGroupQueue> queryAllInQueueTaskGroupQueueByGroupId(@Param("taskGroupId") Integer taskGroupId,
11580
@Param("inQueue") int inQueue);
11681

0 commit comments

Comments
 (0)