Skip to content

Commit 6263dc9

Browse files
苏义超ruanwenjun
authored andcommitted
Simplify the code with lombok annotations
1 parent 74baefa commit 6263dc9

25 files changed

Lines changed: 81 additions & 656 deletions

File tree

dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-oceanbase/src/main/java/org/apache/dolphinscheduler/plugin/datasource/oceanbase/param/OceanBaseDataSourceParamDTO.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,18 @@
2020
import org.apache.dolphinscheduler.plugin.datasource.api.datasource.BaseDataSourceParamDTO;
2121
import org.apache.dolphinscheduler.spi.enums.DbType;
2222

23+
import lombok.Data;
24+
import lombok.EqualsAndHashCode;
25+
26+
@EqualsAndHashCode(callSuper = true)
27+
@Data
2328
public class OceanBaseDataSourceParamDTO extends BaseDataSourceParamDTO {
2429

2530
protected String compatibleMode;
2631

27-
public String getCompatibleMode() {
28-
return compatibleMode;
29-
}
30-
31-
public void setCompatibleMode(String compatibleMode) {
32-
this.compatibleMode = compatibleMode;
33-
}
34-
3532
@Override
3633
public DbType getType() {
3734
return DbType.OCEANBASE;
3835
}
36+
3937
}

dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/future/ResponseFuture.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
import java.util.concurrent.CountDownLatch;
2424
import java.util.concurrent.TimeUnit;
2525

26-
import lombok.Getter;
27-
import lombok.Setter;
26+
import lombok.Data;
2827
import lombok.ToString;
2928
import lombok.extern.slf4j.Slf4j;
3029

3130
@ToString
3231
@Slf4j
32+
@Data
3333
public class ResponseFuture {
3434

3535
private static final ConcurrentHashMap<Long, ResponseFuture> FUTURE_TABLE = new ConcurrentHashMap<>();
@@ -42,8 +42,6 @@ public class ResponseFuture {
4242

4343
private final long beginTimestamp = System.currentTimeMillis();
4444

45-
@Getter
46-
@Setter
4745
private IRpcResponse iRpcResponse;
4846

4947
private volatile boolean sendOk = true;
@@ -92,16 +90,4 @@ public boolean isSendOK() {
9290
return sendOk;
9391
}
9492

95-
public void setSendOk(boolean sendOk) {
96-
this.sendOk = sendOk;
97-
}
98-
99-
public void setCause(Throwable cause) {
100-
this.cause = cause;
101-
}
102-
103-
public Throwable getCause() {
104-
return cause;
105-
}
106-
10793
}

dolphinscheduler-registry/dolphinscheduler-registry-api/src/main/java/org/apache/dolphinscheduler/registry/api/RegistryClient.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
import java.util.Optional;
4242
import java.util.Set;
4343

44+
import lombok.Getter;
45+
import lombok.Setter;
4446
import lombok.extern.slf4j.Slf4j;
4547

4648
import org.springframework.stereotype.Component;
@@ -50,6 +52,9 @@
5052
public class RegistryClient {
5153

5254
private static final String EMPTY = "";
55+
56+
@Setter
57+
@Getter
5358
private IStoppable stoppable;
5459

5560
private final Registry registry;
@@ -201,14 +206,6 @@ public boolean releaseLock(String key) {
201206
return registry.releaseLock(key);
202207
}
203208

204-
public void setStoppable(IStoppable stoppable) {
205-
this.stoppable = stoppable;
206-
}
207-
208-
public IStoppable getStoppable() {
209-
return stoppable;
210-
}
211-
212209
public Collection<String> getChildrenKeys(final String key) {
213210
return registry.children(key);
214211
}

dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/model/TaskNode.java

Lines changed: 3 additions & 200 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@
1717

1818
package org.apache.dolphinscheduler.service.model;
1919

20-
import org.apache.dolphinscheduler.common.constants.Constants;
2120
import org.apache.dolphinscheduler.common.enums.Priority;
2221
import org.apache.dolphinscheduler.common.enums.TaskExecuteType;
2322
import org.apache.dolphinscheduler.common.utils.JSONUtils;
2423

2524
import org.apache.commons.collections4.CollectionUtils;
26-
import org.apache.commons.lang3.StringUtils;
2725

2826
import java.util.List;
2927
import java.util.Objects;
3028

29+
import lombok.Data;
30+
3131
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
3232
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
3333

34+
@Data
3435
public class TaskNode {
3536

3637
/**
@@ -142,98 +143,11 @@ public class TaskNode {
142143

143144
private TaskExecuteType taskExecuteType;
144145

145-
public String getId() {
146-
return id;
147-
}
148-
149-
public void setId(String id) {
150-
this.id = id;
151-
}
152-
153-
public String getName() {
154-
return name;
155-
}
156-
157-
public void setName(String name) {
158-
this.name = name;
159-
}
160-
161-
public String getDesc() {
162-
return desc;
163-
}
164-
165-
public void setDesc(String desc) {
166-
this.desc = desc;
167-
}
168-
169-
public String getType() {
170-
return type;
171-
}
172-
173-
public void setType(String type) {
174-
this.type = type;
175-
}
176-
177-
public String getParams() {
178-
return params;
179-
}
180-
181-
public void setParams(String params) {
182-
this.params = params;
183-
}
184-
185-
public String getPreTasks() {
186-
return preTasks;
187-
}
188-
189146
public void setPreTasks(String preTasks) {
190147
this.preTasks = preTasks;
191148
this.depList = JSONUtils.toList(preTasks, Long.class);
192149
}
193150

194-
public String getExtras() {
195-
return extras;
196-
}
197-
198-
public void setExtras(String extras) {
199-
this.extras = extras;
200-
}
201-
202-
public List<Long> getDepList() {
203-
return depList;
204-
}
205-
206-
public void setDepList(List<Long> depList) {
207-
if (depList != null) {
208-
this.depList = depList;
209-
this.preTasks = JSONUtils.toJsonString(depList);
210-
}
211-
}
212-
213-
public String getLoc() {
214-
return loc;
215-
}
216-
217-
public void setLoc(String loc) {
218-
this.loc = loc;
219-
}
220-
221-
public String getRunFlag() {
222-
return runFlag;
223-
}
224-
225-
public void setRunFlag(String runFlag) {
226-
this.runFlag = runFlag;
227-
}
228-
229-
public boolean isForbidden() {
230-
// skip stream task when run DAG
231-
if (taskExecuteType == TaskExecuteType.STREAM) {
232-
return true;
233-
}
234-
return StringUtils.isNotEmpty(this.runFlag) && this.runFlag.equals(Constants.FLOWNODE_RUN_FLAG_FORBIDDEN);
235-
}
236-
237151
@Override
238152
public boolean equals(Object o) {
239153
if (this == o) {
@@ -261,70 +175,6 @@ public int hashCode() {
261175
return Objects.hash(name, desc, type, params, preTasks, extras, depList, runFlag);
262176
}
263177

264-
public int getMaxRetryTimes() {
265-
return maxRetryTimes;
266-
}
267-
268-
public void setMaxRetryTimes(int maxRetryTimes) {
269-
this.maxRetryTimes = maxRetryTimes;
270-
}
271-
272-
public int getRetryInterval() {
273-
return retryInterval;
274-
}
275-
276-
public void setRetryInterval(int retryInterval) {
277-
this.retryInterval = retryInterval;
278-
}
279-
280-
public Priority getTaskInstancePriority() {
281-
return taskInstancePriority;
282-
}
283-
284-
public void setTaskInstancePriority(Priority taskInstancePriority) {
285-
this.taskInstancePriority = taskInstancePriority;
286-
}
287-
288-
public String getTimeout() {
289-
return timeout;
290-
}
291-
292-
public void setTimeout(String timeout) {
293-
this.timeout = timeout;
294-
}
295-
296-
public String getWorkerGroup() {
297-
return workerGroup;
298-
}
299-
300-
public void setWorkerGroup(String workerGroup) {
301-
this.workerGroup = workerGroup;
302-
}
303-
304-
public int getDelayTime() {
305-
return delayTime;
306-
}
307-
308-
public void setDelayTime(int delayTime) {
309-
this.delayTime = delayTime;
310-
}
311-
312-
public long getCode() {
313-
return code;
314-
}
315-
316-
public void setCode(long code) {
317-
this.code = code;
318-
}
319-
320-
public int getVersion() {
321-
return version;
322-
}
323-
324-
public void setVersion(int version) {
325-
this.version = version;
326-
}
327-
328178
@Override
329179
public String toString() {
330180
return "TaskNode{"
@@ -351,51 +201,4 @@ public String toString() {
351201
+ '}';
352202
}
353203

354-
public void setEnvironmentCode(Long environmentCode) {
355-
this.environmentCode = environmentCode;
356-
}
357-
358-
public Long getEnvironmentCode() {
359-
return this.environmentCode;
360-
}
361-
362-
public int getTaskGroupId() {
363-
return taskGroupId;
364-
}
365-
366-
public void setTaskGroupId(int taskGroupId) {
367-
this.taskGroupId = taskGroupId;
368-
}
369-
370-
public int getTaskGroupPriority() {
371-
return taskGroupPriority;
372-
}
373-
374-
public void setTaskGroupPriority(int taskGroupPriority) {
375-
this.taskGroupPriority = taskGroupPriority;
376-
}
377-
378-
public Integer getCpuQuota() {
379-
return cpuQuota == null ? -1 : cpuQuota;
380-
}
381-
382-
public void setCpuQuota(Integer cpuQuota) {
383-
this.cpuQuota = cpuQuota;
384-
}
385-
386-
public Integer getMemoryMax() {
387-
return memoryMax == null ? -1 : memoryMax;
388-
}
389-
390-
public void setMemoryMax(Integer memoryMax) {
391-
this.memoryMax = memoryMax;
392-
}
393-
394-
public TaskExecuteType getTaskExecuteType() {
395-
return taskExecuteType;
396-
}
397-
398-
public void setTaskExecuteType(TaskExecuteType taskExecuteType) {
399-
this.taskExecuteType = taskExecuteType;
400-
}
401204
}

0 commit comments

Comments
 (0)