public long getUnresponsiveJobTerminationThreshold(JobIdentifier identifier) { JobConfig jobConfig = getJob(identifier); if (jobConfig == null) { return toMillis(Long.parseLong(serverConfig().getJobTimeout())); } String timeout = jobConfig.getTimeout(); return timeout != null ? toMillis(Long.parseLong(timeout)) : toMillis(Long.parseLong(serverConfig().getJobTimeout())); }
public boolean canCancelJobIfHung(JobIdentifier jobIdentifier) { JobConfig jobConfig = getJob(jobIdentifier); if (jobConfig == null) { return false; } String timeout = jobConfig.getTimeout(); if ("0".equals(timeout)) { return false; } if (timeout == null && !"0".equals(serverConfig().getJobTimeout())) { return true; } return timeout != null && !"0".equals(timeout); }