未验证 提交 5169689c 编写于 作者: Y Yelli 提交者: GitHub

class overrides equals() and should therefore also override hashCode() (#1882)

上级 6b0debec
...@@ -145,7 +145,7 @@ public class ZooKeeperState { ...@@ -145,7 +145,7 @@ public class ZooKeeperState {
sendThread.setName("FourLetterCmd:" + cmd); sendThread.setName("FourLetterCmd:" + cmd);
sendThread.start(); sendThread.start();
try { try {
sendThread.join(waitTimeout * 1000); sendThread.join(waitTimeout * 1000L);
return sendThread.ret; return sendThread.ret;
} catch (InterruptedException e) { } catch (InterruptedException e) {
logger.error("send " + cmd + " to server " + host + ":" + port + " failed!", e); logger.error("send " + cmd + " to server " + host + ":" + port + " failed!", e);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package org.apache.dolphinscheduler.common.model; package org.apache.dolphinscheduler.common.model;
import java.util.Date; import java.util.Date;
import java.util.Objects;
/** /**
* date interval class * date interval class
...@@ -62,4 +63,8 @@ public class DateInterval { ...@@ -62,4 +63,8 @@ public class DateInterval {
this.endTime = endTime; this.endTime = endTime;
} }
@Override
public int hashCode() {
return Objects.hash(startTime, endTime);
}
} }
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
*/ */
package org.apache.dolphinscheduler.common.model; package org.apache.dolphinscheduler.common.model;
import java.util.Objects;
public class TaskNodeRelation { public class TaskNodeRelation {
/** /**
...@@ -69,4 +71,9 @@ public class TaskNodeRelation { ...@@ -69,4 +71,9 @@ public class TaskNodeRelation {
", endNode='" + endNode + '\'' + ", endNode='" + endNode + '\'' +
'}'; '}';
} }
@Override
public int hashCode() {
return Objects.hash(startNode, endNode);
}
} }
...@@ -122,7 +122,7 @@ public class MasterTaskExecThread extends MasterBaseTaskExecThread { ...@@ -122,7 +122,7 @@ public class MasterTaskExecThread extends MasterBaseTaskExecThread {
break; break;
} }
if(checkTimeout){ if(checkTimeout){
long remainTime = getRemaintime(taskTimeoutParameter.getInterval()*60); long remainTime = getRemaintime(taskTimeoutParameter.getInterval() * 60L);
if (remainTime < 0) { if (remainTime < 0) {
logger.warn("task id: {} execution time out",taskInstance.getId()); logger.warn("task id: {} execution time out",taskInstance.getId());
// process define // process define
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册