From e5462741c20f742a362738117f3c0d04ae355f95 Mon Sep 17 00:00:00 2001 From: chengp <5058557@qq.com> Date: Thu, 10 Dec 2020 14:20:38 +0800 Subject: [PATCH] fix bug #4125 (#4127) * fix bug #4125 * code style! * code style. Co-authored-by: chengp --- .../remote/command/DBTaskAckCommand.java | 12 +++++------ .../remote/command/DBTaskResponseCommand.java | 20 ++++++++++++------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/command/DBTaskAckCommand.java b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/command/DBTaskAckCommand.java index 9faa0a7c7e5e..479710445067 100644 --- a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/command/DBTaskAckCommand.java +++ b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/command/DBTaskAckCommand.java @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dolphinscheduler.remote.command; +package org.apache.dolphinscheduler.remote.command; import org.apache.dolphinscheduler.common.utils.JSONUtils; @@ -29,6 +29,10 @@ public class DBTaskAckCommand implements Serializable { private int taskInstanceId; private int status; + public DBTaskAckCommand() { + super(); + } + public DBTaskAckCommand(int status, int taskInstanceId) { this.status = status; this.taskInstanceId = taskInstanceId; @@ -63,12 +67,8 @@ public Command convert2Command() { return command; } - @Override public String toString() { - return "DBTaskAckCommand{" + - "taskInstanceId=" + taskInstanceId + - ", status=" + status + - '}'; + return "DBTaskAckCommand{" + "taskInstanceId=" + taskInstanceId + ", status=" + status + '}'; } } diff --git a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/command/DBTaskResponseCommand.java b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/command/DBTaskResponseCommand.java index e46cffafe2e1..9bd86cbdf40e 100644 --- a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/command/DBTaskResponseCommand.java +++ b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/command/DBTaskResponseCommand.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.remote.command; import org.apache.dolphinscheduler.common.utils.JSONUtils; @@ -21,14 +22,18 @@ import java.io.Serializable; /** - * db task final result response command + * db task final result response command */ public class DBTaskResponseCommand implements Serializable { private int taskInstanceId; private int status; - public DBTaskResponseCommand(int status,int taskInstanceId) { + public DBTaskResponseCommand() { + super(); + } + + public DBTaskResponseCommand(int status, int taskInstanceId) { this.status = status; this.taskInstanceId = taskInstanceId; } @@ -51,9 +56,10 @@ public void setTaskInstanceId(int taskInstanceId) { /** * package response command + * * @return command */ - public Command convert2Command(){ + public Command convert2Command() { Command command = new Command(); command.setType(CommandType.DB_TASK_RESPONSE); byte[] body = JSONUtils.toJsonByteArray(this); @@ -63,9 +69,9 @@ public Command convert2Command(){ @Override public String toString() { - return "DBTaskResponseCommand{" + - "taskInstanceId=" + taskInstanceId + - ", status=" + status + - '}'; + return "DBTaskResponseCommand{" + + "taskInstanceId=" + taskInstanceId + + ", status=" + status + + '}'; } }