You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by jo...@apache.org on 2020/01/09 02:41:31 UTC

[incubator-dolphinscheduler] branch dev updated: remove lombok dependency(last) (#1771)

This is an automated email from the ASF dual-hosted git repository.

journey pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new aa715e1  remove lombok dependency(last) (#1771)
aa715e1 is described below

commit aa715e17bf703aac3dc2572313416a5217215bbc
Author: DK.Pino <lo...@vipkid.com.cn>
AuthorDate: Thu Jan 9 10:41:23 2020 +0800

    remove lombok dependency(last) (#1771)
---
 dolphinscheduler-dao/pom.xml                       |  6 +-
 .../dolphinscheduler/dao/entity/AccessToken.java   | 18 +----
 .../dao/entity/ProcessInstance.java                | 84 +---------------------
 .../dolphinscheduler/dao/entity/ProjectUser.java   |  2 -
 .../apache/dolphinscheduler/dao/entity/Queue.java  | 22 +++++-
 .../dolphinscheduler/dao/entity/Resource.java      |  2 -
 .../dolphinscheduler/dao/entity/ResourcesUser.java |  2 -
 .../dolphinscheduler/dao/entity/Session.java       | 24 ++++++-
 .../apache/dolphinscheduler/dao/entity/Tenant.java | 18 ++++-
 .../dolphinscheduler/dao/entity/UDFUser.java       |  2 -
 .../dolphinscheduler/dao/entity/UdfFunc.java       |  2 -
 .../server/worker/log/SensitiveDataConverter.java  |  2 -
 pom.xml                                            |  6 --
 13 files changed, 65 insertions(+), 125 deletions(-)

diff --git a/dolphinscheduler-dao/pom.xml b/dolphinscheduler-dao/pom.xml
index c994716..b3b22c1 100644
--- a/dolphinscheduler-dao/pom.xml
+++ b/dolphinscheduler-dao/pom.xml
@@ -49,11 +49,7 @@
 			<groupId>org.postgresql</groupId>
 			<artifactId>postgresql</artifactId>
 		</dependency>
-		<dependency>
-			<groupId>org.projectlombok</groupId>
-			<artifactId>lombok</artifactId>
-			<version>${lombok.version}</version>
-		</dependency>
+		
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-test</artifactId>
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AccessToken.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AccessToken.java
index af9d9cd..a65e9c0 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AccessToken.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AccessToken.java
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 
 import java.util.Date;
+import java.util.Objects;
 
 @TableName("t_ds_access_token")
 public class AccessToken {
@@ -111,25 +112,12 @@ public class AccessToken {
 
         AccessToken that = (AccessToken) o;
 
-        if (id != that.id) return false;
-        if (userId != that.userId) return false;
-        if (token != null ? !token.equals(that.token) : that.token != null) return false;
-        if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
-        if (expireTime != null ? !expireTime.equals(that.expireTime) : that.expireTime != null) return false;
-        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;
-        return updateTime != null ? updateTime.equals(that.updateTime) : that.updateTime == null;
+        return id == that.id;
     }
 
     @Override
     public int hashCode() {
-        int result = id;
-        result = 31 * result + userId;
-        result = 31 * result + (token != null ? token.hashCode() : 0);
-        result = 31 * result + (userName != null ? userName.hashCode() : 0);
-        result = 31 * result + (expireTime != null ? expireTime.hashCode() : 0);
-        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
-        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
-        return result;
+        return Objects.hash(id);
     }
 
     @Override
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessInstance.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessInstance.java
index f708e49..54c96e9 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessInstance.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessInstance.java
@@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import org.apache.dolphinscheduler.common.enums.*;
 
 import java.util.Date;
+import java.util.Objects;
 
 /**
  * process instance
@@ -625,90 +626,11 @@ public class ProcessInstance {
 
         ProcessInstance that = (ProcessInstance) o;
 
-        if (id != that.id) return false;
-        if (processDefinitionId != that.processDefinitionId) return false;
-        if (runTimes != that.runTimes) return false;
-        if (maxTryTimes != that.maxTryTimes) return false;
-        if (executorId != that.executorId) return false;
-        if (workerGroupId != that.workerGroupId) return false;
-        if (timeout != that.timeout) return false;
-        if (tenantId != that.tenantId) return false;
-        if (state != that.state) return false;
-        if (recovery != that.recovery) return false;
-        if (startTime != null ? !startTime.equals(that.startTime) : that.startTime != null) return false;
-        if (endTime != null ? !endTime.equals(that.endTime) : that.endTime != null) return false;
-        if (name != null ? !name.equals(that.name) : that.name != null) return false;
-        if (host != null ? !host.equals(that.host) : that.host != null) return false;
-        if (processDefinition != null ? !processDefinition.equals(that.processDefinition) : that.processDefinition != null)
-            return false;
-        if (commandType != that.commandType) return false;
-        if (commandParam != null ? !commandParam.equals(that.commandParam) : that.commandParam != null) return false;
-        if (taskDependType != that.taskDependType) return false;
-        if (failureStrategy != that.failureStrategy) return false;
-        if (warningType != that.warningType) return false;
-        if (warningGroupId != null ? !warningGroupId.equals(that.warningGroupId) : that.warningGroupId != null)
-            return false;
-        if (scheduleTime != null ? !scheduleTime.equals(that.scheduleTime) : that.scheduleTime != null) return false;
-        if (commandStartTime != null ? !commandStartTime.equals(that.commandStartTime) : that.commandStartTime != null)
-            return false;
-        if (globalParams != null ? !globalParams.equals(that.globalParams) : that.globalParams != null) return false;
-        if (processInstanceJson != null ? !processInstanceJson.equals(that.processInstanceJson) : that.processInstanceJson != null)
-            return false;
-        if (tenantCode != null ? !tenantCode.equals(that.tenantCode) : that.tenantCode != null) return false;
-        if (queue != null ? !queue.equals(that.queue) : that.queue != null) return false;
-        if (isSubProcess != that.isSubProcess) return false;
-        if (locations != null ? !locations.equals(that.locations) : that.locations != null) return false;
-        if (connects != null ? !connects.equals(that.connects) : that.connects != null) return false;
-        if (historyCmd != null ? !historyCmd.equals(that.historyCmd) : that.historyCmd != null) return false;
-        if (dependenceScheduleTimes != null ? !dependenceScheduleTimes.equals(that.dependenceScheduleTimes) : that.dependenceScheduleTimes != null)
-            return false;
-        if (duration != null ? !duration.equals(that.duration) : that.duration != null) return false;
-        if (processInstancePriority != that.processInstancePriority) return false;
-        if (workerGroupName != null ? !workerGroupName.equals(that.workerGroupName) : that.workerGroupName != null)
-            return false;
-        if (receivers != null ? !receivers.equals(that.receivers) : that.receivers != null) return false;
-        return receiversCc != null ? receiversCc.equals(that.receiversCc) : that.receiversCc == null;
+        return id == that.id;
     }
 
     @Override
     public int hashCode() {
-        int result = id;
-        result = 31 * result + processDefinitionId;
-        result = 31 * result + (state != null ? state.hashCode() : 0);
-        result = 31 * result + (recovery != null ? recovery.hashCode() : 0);
-        result = 31 * result + (startTime != null ? startTime.hashCode() : 0);
-        result = 31 * result + (endTime != null ? endTime.hashCode() : 0);
-        result = 31 * result + runTimes;
-        result = 31 * result + (name != null ? name.hashCode() : 0);
-        result = 31 * result + (host != null ? host.hashCode() : 0);
-        result = 31 * result + (processDefinition != null ? processDefinition.hashCode() : 0);
-        result = 31 * result + (commandType != null ? commandType.hashCode() : 0);
-        result = 31 * result + (commandParam != null ? commandParam.hashCode() : 0);
-        result = 31 * result + (taskDependType != null ? taskDependType.hashCode() : 0);
-        result = 31 * result + maxTryTimes;
-        result = 31 * result + (failureStrategy != null ? failureStrategy.hashCode() : 0);
-        result = 31 * result + (warningType != null ? warningType.hashCode() : 0);
-        result = 31 * result + (warningGroupId != null ? warningGroupId.hashCode() : 0);
-        result = 31 * result + (scheduleTime != null ? scheduleTime.hashCode() : 0);
-        result = 31 * result + (commandStartTime != null ? commandStartTime.hashCode() : 0);
-        result = 31 * result + (globalParams != null ? globalParams.hashCode() : 0);
-        result = 31 * result + (processInstanceJson != null ? processInstanceJson.hashCode() : 0);
-        result = 31 * result + executorId;
-        result = 31 * result + (tenantCode != null ? tenantCode.hashCode() : 0);
-        result = 31 * result + (queue != null ? queue.hashCode() : 0);
-        result = 31 * result + (isSubProcess != null ? isSubProcess.hashCode() : 0);
-        result = 31 * result + (locations != null ? locations.hashCode() : 0);
-        result = 31 * result + (connects != null ? connects.hashCode() : 0);
-        result = 31 * result + (historyCmd != null ? historyCmd.hashCode() : 0);
-        result = 31 * result + (dependenceScheduleTimes != null ? dependenceScheduleTimes.hashCode() : 0);
-        result = 31 * result + (duration != null ? duration.hashCode() : 0);
-        result = 31 * result + (processInstancePriority != null ? processInstancePriority.hashCode() : 0);
-        result = 31 * result + workerGroupId;
-        result = 31 * result + timeout;
-        result = 31 * result + tenantId;
-        result = 31 * result + (workerGroupName != null ? workerGroupName.hashCode() : 0);
-        result = 31 * result + (receivers != null ? receivers.hashCode() : 0);
-        result = 31 * result + (receiversCc != null ? receiversCc.hashCode() : 0);
-        return result;
+        return Objects.hash(id);
     }
 }
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProjectUser.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProjectUser.java
index 188749b..d54f209 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProjectUser.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProjectUser.java
@@ -20,11 +20,9 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
 
 import java.util.Date;
 
-@Data
 @TableName("t_ds_relation_project_user")
 public class ProjectUser {
     /**
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Queue.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Queue.java
index 7a2894a..5d8f7e2 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Queue.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Queue.java
@@ -19,14 +19,12 @@ package org.apache.dolphinscheduler.dao.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
 
 import java.util.Date;
 
 /**
  * queue
  */
-@Data
 @TableName("t_ds_queue")
 public class Queue {
 
@@ -103,4 +101,24 @@ public class Queue {
                 ", updateTime=" + updateTime +
                 '}';
     }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        Queue queue1 = (Queue) o;
+
+        if (id != queue1.id) return false;
+        if (!queueName.equals(queue1.queueName)) return false;
+        return queue.equals(queue1.queue);
+    }
+
+    @Override
+    public int hashCode() {
+        int result = id;
+        result = 31 * result + queueName.hashCode();
+        result = 31 * result + queue.hashCode();
+        return result;
+    }
 }
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Resource.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Resource.java
index b2b5785..934be4b 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Resource.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Resource.java
@@ -21,11 +21,9 @@ import org.apache.dolphinscheduler.common.enums.ResourceType;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
 
 import java.util.Date;
 
-@Data
 @TableName("t_ds_resources")
 public class Resource {
   /**
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ResourcesUser.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ResourcesUser.java
index 0901153..dc62a7b 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ResourcesUser.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ResourcesUser.java
@@ -19,14 +19,12 @@ package org.apache.dolphinscheduler.dao.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
 
 import java.util.Date;
 
 /**
  * resource user relation
  */
-@Data
 @TableName("t_ds_relation_resources_user")
 public class ResourcesUser {
 
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Session.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Session.java
index e47ddb6..83bf246 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Session.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Session.java
@@ -19,14 +19,12 @@ package org.apache.dolphinscheduler.dao.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
 
 import java.util.Date;
 
 /**
  * session
  */
-@Data
 @TableName("t_ds_session")
 public class Session {
 
@@ -92,4 +90,26 @@ public class Session {
                 ", lastLoginTime=" + lastLoginTime +
                 '}';
     }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        Session session = (Session) o;
+
+        if (userId != session.userId) return false;
+        if (!id.equals(session.id)) return false;
+        if (!lastLoginTime.equals(session.lastLoginTime)) return false;
+        return ip.equals(session.ip);
+    }
+
+    @Override
+    public int hashCode() {
+        int result = id.hashCode();
+        result = 31 * result + userId;
+        result = 31 * result + lastLoginTime.hashCode();
+        result = 31 * result + ip.hashCode();
+        return result;
+    }
 }
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Tenant.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Tenant.java
index 72ebaaa..bf23ad5 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Tenant.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Tenant.java
@@ -20,14 +20,13 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
 
 import java.util.Date;
+import java.util.Objects;
 
 /**
  * tenant
  */
-@Data
 @TableName("t_ds_tenant")
 public class Tenant {
 
@@ -164,4 +163,19 @@ public class Tenant {
     public void setDescription(String description) {
         this.description = description;
     }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        Tenant tenant = (Tenant) o;
+
+        return id == tenant.id;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id);
+    }
 }
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UDFUser.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UDFUser.java
index aea1a40..c21eb96 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UDFUser.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UDFUser.java
@@ -19,14 +19,12 @@ package org.apache.dolphinscheduler.dao.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
 
 import java.util.Date;
 
 /**
  * udf user relation
  */
-@Data
 @TableName("t_ds_relation_udfs_user")
 public class UDFUser {
 
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
index fa70d1e..9093034 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
@@ -21,14 +21,12 @@ import org.apache.dolphinscheduler.common.enums.UdfType;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
 
 import java.util.Date;
 
 /**
  * udf function
  */
-@Data
 @TableName("t_ds_udfs")
 public class UdfFunc {
     /**
diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/log/SensitiveDataConverter.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/log/SensitiveDataConverter.java
index 2406a4d..4a98e66 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/log/SensitiveDataConverter.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/log/SensitiveDataConverter.java
@@ -19,7 +19,6 @@ package org.apache.dolphinscheduler.server.worker.log;
 
 import ch.qos.logback.classic.pattern.MessageConverter;
 import ch.qos.logback.classic.spi.ILoggingEvent;
-import lombok.extern.slf4j.Slf4j;
 import org.apache.dolphinscheduler.common.Constants;
 import org.apache.dolphinscheduler.common.utils.StringUtils;
 import org.apache.dolphinscheduler.server.utils.SensitiveLogUtil;
@@ -30,7 +29,6 @@ import java.util.regex.Pattern;
 /**
  * sensitive data log converter
  */
-@Slf4j
 public class SensitiveDataConverter extends MessageConverter {
 
     /**
diff --git a/pom.xml b/pom.xml
index 09156b7..c5e146e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -64,7 +64,6 @@
 		<quartz.version>2.2.3</quartz.version>
 		<jackson.version>2.9.8</jackson.version>
 		<mybatis-plus.version>3.2.0</mybatis-plus.version>
-		<lombok.version>1.18.4</lombok.version>
 		<mybatis.spring.version>2.0.1</mybatis.spring.version>
 		<cron.utils.version>5.0.5</cron.utils.version>
 		<fastjson.version>1.2.61</fastjson.version>
@@ -834,11 +833,6 @@
 					<format>xml</format>
 					<instrumentation>
 						<ignoreTrivial>true</ignoreTrivial>
-						<ignoreMethodAnnotations>
-							<ignoreMethodAnnotation>lombok.Generated</ignoreMethodAnnotation>
-						</ignoreMethodAnnotations>
-						<excludes>
-						</excludes>
 					</instrumentation>
 				</configuration>
 			</plugin>