Skip to content

Commit

Permalink
fix bug #4125 (#4127)
Browse files Browse the repository at this point in the history
* fix bug #4125

* code style!

* code style.

Co-authored-by: chengp <chengp@chengp.net>
  • Loading branch information
chengpeng2015 and chengpeng2015 authored Dec 10, 2020
1 parent aa19a06 commit e546274
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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 + '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,26 @@
* 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;

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;
}
Expand All @@ -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);
Expand All @@ -63,9 +69,9 @@ public Command convert2Command(){

@Override
public String toString() {
return "DBTaskResponseCommand{" +
"taskInstanceId=" + taskInstanceId +
", status=" + status +
'}';
return "DBTaskResponseCommand{"
+ "taskInstanceId=" + taskInstanceId
+ ", status=" + status
+ '}';
}
}

0 comments on commit e546274

Please sign in to comment.