Browse Source

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

pull/2/head
Yelli 5 years ago committed by GitHub
parent
commit
5169689c35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/ZooKeeperState.java
  2. 5
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/DateInterval.java
  3. 7
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/TaskNodeRelation.java
  4. 2
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterTaskExecThread.java

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/ZooKeeperState.java

@ -145,7 +145,7 @@ public class ZooKeeperState {
sendThread.setName("FourLetterCmd:" + cmd);
sendThread.start();
try {
sendThread.join(waitTimeout * 1000);
sendThread.join(waitTimeout * 1000L);
return sendThread.ret;
} catch (InterruptedException e) {
logger.error("send " + cmd + " to server " + host + ":" + port + " failed!", e);

5
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/DateInterval.java

@ -17,6 +17,7 @@
package org.apache.dolphinscheduler.common.model;
import java.util.Date;
import java.util.Objects;
/**
* date interval class
@ -62,4 +63,8 @@ public class DateInterval {
this.endTime = endTime;
}
@Override
public int hashCode() {
return Objects.hash(startTime, endTime);
}
}

7
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/TaskNodeRelation.java

@ -16,6 +16,8 @@
*/
package org.apache.dolphinscheduler.common.model;
import java.util.Objects;
public class TaskNodeRelation {
/**
@ -69,4 +71,9 @@ public class TaskNodeRelation {
", endNode='" + endNode + '\'' +
'}';
}
@Override
public int hashCode() {
return Objects.hash(startNode, endNode);
}
}

2
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterTaskExecThread.java

@ -122,7 +122,7 @@ public class MasterTaskExecThread extends MasterBaseTaskExecThread {
break;
}
if(checkTimeout){
long remainTime = getRemaintime(taskTimeoutParameter.getInterval()*60);
long remainTime = getRemaintime(taskTimeoutParameter.getInterval() * 60L);
if (remainTime < 0) {
logger.warn("task id: {} execution time out",taskInstance.getId());
// process define

Loading…
Cancel
Save