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 095e38697d..ae302841fa 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 @@ -16,7 +16,8 @@ */ package org.apache.dolphinscheduler.remote.command; -import org.apache.dolphinscheduler.remote.utils.JsonSerializer; + +import org.apache.dolphinscheduler.common.utils.JSONUtils; import java.io.Serializable; @@ -56,7 +57,7 @@ public class DBTaskAckCommand implements Serializable { public Command convert2Command(){ Command command = new Command(); command.setType(CommandType.DB_TASK_ACK); - byte[] body = JsonSerializer.serialize(this); + byte[] body = JSONUtils.toJsonByteArray(this); command.setBody(body); return command; } 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 56712e4c93..e46cffafe2 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 @@ -16,7 +16,7 @@ */ package org.apache.dolphinscheduler.remote.command; -import org.apache.dolphinscheduler.remote.utils.JsonSerializer; +import org.apache.dolphinscheduler.common.utils.JSONUtils; import java.io.Serializable; @@ -56,7 +56,7 @@ public class DBTaskResponseCommand implements Serializable { public Command convert2Command(){ Command command = new Command(); command.setType(CommandType.DB_TASK_RESPONSE); - byte[] body = JsonSerializer.serialize(this); + byte[] body = JSONUtils.toJsonByteArray(this); command.setBody(body); return command; } diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/DBTaskAckProcessor.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/DBTaskAckProcessor.java index 1ccd092554..551661722f 100644 --- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/DBTaskAckProcessor.java +++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/DBTaskAckProcessor.java @@ -19,10 +19,10 @@ package org.apache.dolphinscheduler.server.worker.processor; import io.netty.channel.Channel; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; +import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.common.utils.Preconditions; import org.apache.dolphinscheduler.remote.command.*; import org.apache.dolphinscheduler.remote.processor.NettyRequestProcessor; -import org.apache.dolphinscheduler.remote.utils.JsonSerializer; import org.apache.dolphinscheduler.server.worker.cache.ResponceCache; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,7 +40,7 @@ public class DBTaskAckProcessor implements NettyRequestProcessor { Preconditions.checkArgument(CommandType.DB_TASK_ACK == command.getType(), String.format("invalid command type : %s", command.getType())); - DBTaskAckCommand taskAckCommand = JsonSerializer.deserialize( + DBTaskAckCommand taskAckCommand = JSONUtils.parseObject( command.getBody(), DBTaskAckCommand.class); if (taskAckCommand == null){ diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/DBTaskResponseProcessor.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/DBTaskResponseProcessor.java index 52536ab7be..e382245b63 100644 --- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/DBTaskResponseProcessor.java +++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/DBTaskResponseProcessor.java @@ -19,12 +19,12 @@ package org.apache.dolphinscheduler.server.worker.processor; import io.netty.channel.Channel; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; +import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.common.utils.Preconditions; import org.apache.dolphinscheduler.remote.command.Command; import org.apache.dolphinscheduler.remote.command.CommandType; import org.apache.dolphinscheduler.remote.command.DBTaskResponseCommand; import org.apache.dolphinscheduler.remote.processor.NettyRequestProcessor; -import org.apache.dolphinscheduler.remote.utils.JsonSerializer; import org.apache.dolphinscheduler.server.worker.cache.ResponceCache; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -42,7 +42,7 @@ public class DBTaskResponseProcessor implements NettyRequestProcessor { Preconditions.checkArgument(CommandType.DB_TASK_RESPONSE == command.getType(), String.format("invalid command type : %s", command.getType())); - DBTaskResponseCommand taskResponseCommand = JsonSerializer.deserialize( + DBTaskResponseCommand taskResponseCommand = JSONUtils.parseObject( command.getBody(), DBTaskResponseCommand.class); if (taskResponseCommand == null){