This is an automated email from the ASF dual-hosted git repository. roryqi pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/master by this push: new bf0ca870a [#1990] improvement(infra): introduce Lombok (#1999) bf0ca870a is described below commit bf0ca870aae0c83fbc746bdcca5492f63020a476 Author: xianjingfeng <xianjingfeng...@gmail.com> AuthorDate: Fri Aug 2 11:00:23 2024 +0800 [#1990] improvement(infra): introduce Lombok (#1999) ### What changes were proposed in this pull request? Introduce Lombok ### Why are the changes needed? Fix: #1990 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? CI --- coordinator/pom.xml | 4 ++ .../uniffle/coordinator/web/vo/AppInfoVO.java | 82 ++-------------------- .../coordinator/web/vo/CoordinatorConfVO.java | 26 ++----- .../uniffle/coordinator/web/vo/UserAppNumVO.java | 43 ++---------- pom.xml | 7 ++ server/pom.xml | 4 ++ .../apache/uniffle/server/web/vo/ServerConfVO.java | 26 ++----- 7 files changed, 35 insertions(+), 157 deletions(-) diff --git a/coordinator/pom.xml b/coordinator/pom.xml index 763371497..eea080326 100644 --- a/coordinator/pom.xml +++ b/coordinator/pom.xml @@ -98,6 +98,10 @@ <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </dependency> </dependencies> <build> diff --git a/coordinator/src/main/java/org/apache/uniffle/coordinator/web/vo/AppInfoVO.java b/coordinator/src/main/java/org/apache/uniffle/coordinator/web/vo/AppInfoVO.java index 0c8ba9f38..2d6c8e1d0 100644 --- a/coordinator/src/main/java/org/apache/uniffle/coordinator/web/vo/AppInfoVO.java +++ b/coordinator/src/main/java/org/apache/uniffle/coordinator/web/vo/AppInfoVO.java @@ -17,8 +17,13 @@ package org.apache.uniffle.coordinator.web.vo; -import java.util.Objects; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +@Data +@Builder +@AllArgsConstructor public class AppInfoVO implements Comparable<AppInfoVO> { private String userName; private String appId; @@ -27,83 +32,8 @@ public class AppInfoVO implements Comparable<AppInfoVO> { private String version; private String gitCommitId; - public AppInfoVO( - String userName, - String appId, - long updateTime, - long registrationTime, - String version, - String gitCommitId) { - this.userName = userName; - this.appId = appId; - this.updateTime = updateTime; - this.registrationTime = registrationTime; - this.version = version; - this.gitCommitId = gitCommitId; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getAppId() { - return appId; - } - - public void setAppId(String appId) { - this.appId = appId; - } - - public long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(long updateTime) { - this.updateTime = updateTime; - } - - public long getRegistrationTime() { - return registrationTime; - } - - public void setRegistrationTime(long registrationTime) { - this.registrationTime = registrationTime; - } - - public String getVersion() { - return version; - } - - public String getGitCommitId() { - return gitCommitId; - } - @Override public int compareTo(AppInfoVO appInfoVO) { return Long.compare(registrationTime, appInfoVO.getRegistrationTime()); } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof AppInfoVO)) { - return false; - } - AppInfoVO appInfoVO = (AppInfoVO) o; - return updateTime == appInfoVO.updateTime - && registrationTime == appInfoVO.registrationTime - && userName.equals(appInfoVO.userName) - && appId.equals(appInfoVO.appId); - } - - @Override - public int hashCode() { - return Objects.hash(userName, appId, updateTime, registrationTime); - } } diff --git a/coordinator/src/main/java/org/apache/uniffle/coordinator/web/vo/CoordinatorConfVO.java b/coordinator/src/main/java/org/apache/uniffle/coordinator/web/vo/CoordinatorConfVO.java index b3137ca8a..57398a20d 100644 --- a/coordinator/src/main/java/org/apache/uniffle/coordinator/web/vo/CoordinatorConfVO.java +++ b/coordinator/src/main/java/org/apache/uniffle/coordinator/web/vo/CoordinatorConfVO.java @@ -17,28 +17,12 @@ package org.apache.uniffle.coordinator.web.vo; +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor public class CoordinatorConfVO { private String argumentKey; private String argumentValue; - - public CoordinatorConfVO(String argumentKey, String argumentValue) { - this.argumentKey = argumentKey; - this.argumentValue = argumentValue; - } - - public String getArgumentKey() { - return argumentKey; - } - - public void setArgumentKey(String argumentKey) { - this.argumentKey = argumentKey; - } - - public String getArgumentValue() { - return argumentValue; - } - - public void setArgumentValue(String argumentValue) { - this.argumentValue = argumentValue; - } } diff --git a/coordinator/src/main/java/org/apache/uniffle/coordinator/web/vo/UserAppNumVO.java b/coordinator/src/main/java/org/apache/uniffle/coordinator/web/vo/UserAppNumVO.java index 6d5b56bb2..7da47f907 100644 --- a/coordinator/src/main/java/org/apache/uniffle/coordinator/web/vo/UserAppNumVO.java +++ b/coordinator/src/main/java/org/apache/uniffle/coordinator/web/vo/UserAppNumVO.java @@ -17,53 +17,18 @@ package org.apache.uniffle.coordinator.web.vo; -import java.util.Objects; +import lombok.AllArgsConstructor; +import lombok.Data; +@Data +@AllArgsConstructor public class UserAppNumVO implements Comparable<UserAppNumVO> { private String userName; private Integer appNum; - public UserAppNumVO(String userName, Integer appNum) { - this.userName = userName; - this.appNum = appNum; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public Integer getAppNum() { - return appNum; - } - - public void setAppNum(Integer appNum) { - this.appNum = appNum; - } - @Override public int compareTo(UserAppNumVO userAppNumVO) { return Integer.compare(appNum, userAppNumVO.getAppNum()); } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof UserAppNumVO)) { - return false; - } - UserAppNumVO that = (UserAppNumVO) o; - return userName.equals(that.userName) && appNum.equals(that.appNum); - } - - @Override - public int hashCode() { - return Objects.hash(userName, appNum); - } } diff --git a/pom.xml b/pom.xml index f691a96d3..e88c44256 100644 --- a/pom.xml +++ b/pom.xml @@ -79,6 +79,7 @@ <junit.platform.version>1.8.2</junit.platform.version> <system.stubs.version>2.0.1</system.stubs.version> <log4j.version>2.23.0</log4j.version> + <lombok.version>1.18.34</lombok.version> <maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version> <maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.target>${java.version}</maven.compiler.target> @@ -780,6 +781,12 @@ <version>${log4j.version}</version> </dependency> <!-- end --> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>${lombok.version}</version> + <scope>provided</scope> + </dependency> </dependencies> </dependencyManagement> diff --git a/server/pom.xml b/server/pom.xml index 2c5828b49..571946e29 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -155,6 +155,10 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </dependency> </dependencies> <build> diff --git a/server/src/main/java/org/apache/uniffle/server/web/vo/ServerConfVO.java b/server/src/main/java/org/apache/uniffle/server/web/vo/ServerConfVO.java index 0cf3ffe3f..f9e7656ac 100644 --- a/server/src/main/java/org/apache/uniffle/server/web/vo/ServerConfVO.java +++ b/server/src/main/java/org/apache/uniffle/server/web/vo/ServerConfVO.java @@ -17,28 +17,12 @@ package org.apache.uniffle.server.web.vo; +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor public class ServerConfVO { private String argumentKey; private String argumentValue; - - public ServerConfVO(String argumentKey, String argumentValue) { - this.argumentKey = argumentKey; - this.argumentValue = argumentValue; - } - - public String getArgumentKey() { - return argumentKey; - } - - public void setArgumentKey(String argumentKey) { - this.argumentKey = argumentKey; - } - - public String getArgumentValue() { - return argumentValue; - } - - public void setArgumentValue(String argumentValue) { - this.argumentValue = argumentValue; - } }