public void task(final JobId jobId, final String host, final TaskStatus ts, final Deployment deployment) { final String goal = (deployment == null) ? "" : deployment.getGoal().toString(); final int maxContainerId = full ? Integer.MAX_VALUE : 7; final String jobIdString = full ? jobId.toString() : jobId.toShortString(); if (ts == null) { table.row(jobIdString, host, goal, "", "", ""); } else { final List<String> portMappings = new ArrayList<>(); for (final Map.Entry<String, PortMapping> entry : ts.getPorts().entrySet()) { final PortMapping portMapping = entry.getValue(); portMappings.add(String.format("%s=%d:%d", entry.getKey(), portMapping.getInternalPort(), portMapping.getExternalPort())); } String state = ts.getState().toString(); if (ts.getThrottled() != ThrottleState.NO) { state += " (" + ts.getThrottled() + ")"; } final String ports = Joiner.on(" ").join(portMappings); final String cid = truncate(fromNullable(ts.getContainerId()).or(""), maxContainerId, ""); table.row(jobIdString, host, goal, state, cid, ports); } }
@Override public int hashCode() { int result = job != null ? job.hashCode() : 0; result = 31 * result + (goal != null ? goal.hashCode() : 0); result = 31 * result + (state != null ? state.hashCode() : 0); result = 31 * result + (containerId != null ? containerId.hashCode() : 0); result = 31 * result + (throttled != null ? throttled.hashCode() : 0); result = 31 * result + (ports != null ? ports.hashCode() : 0); result = 31 * result + (env != null ? env.hashCode() : 0); result = 31 * result + (containerError != null ? containerError.hashCode() : 0); return result; }
.equals(TaskStatus.State.RUNNING)) {
hostStatus.getState().toString() : "-";
public void task(final JobId jobId, final String host, final TaskStatus ts, final Deployment deployment) { final String goal = (deployment == null) ? "" : deployment.getGoal().toString(); final int maxContainerId = full ? Integer.MAX_VALUE : 7; final String jobIdString = full ? jobId.toString() : jobId.toShortString(); if (ts == null) { table.row(jobIdString, host, goal, "", "", ""); } else { final List<String> portMappings = new ArrayList<>(); for (Map.Entry<String, PortMapping> entry : ts.getPorts().entrySet()) { final PortMapping portMapping = entry.getValue(); portMappings.add(String.format("%s=%d:%d", entry.getKey(), portMapping.getInternalPort(), portMapping.getExternalPort())); } String state = ts.getState().toString(); if (ts.getThrottled() != ThrottleState.NO) { state += " (" + ts.getThrottled() + ")"; } final String ports = Joiner.on(" ").join(portMappings); final String cid = truncate(fromNullable(ts.getContainerId()).or(""), maxContainerId, ""); table.row(jobIdString, host, goal, state, cid, ports); } }
private void verifyHealthy(final String host, final TaskStatus status) { log.debug("Checking health of {} on {}", job.getImage(), host); final TaskStatus.State state = status.getState(); if (state == TaskStatus.State.FAILED || state == TaskStatus.State.EXITED || state == TaskStatus.State.STOPPED) { // Throw exception which should stop the test dead in it's tracks String stateString = state.toString(); if (status.getThrottled() != ThrottleState.NO) { stateString += format("(%s)", status.getThrottled()); } throw new AssertionError(format( "Unexpected job state %s for job %s with image %s on host %s. Check helios agent " + "logs for details.", stateString, job.getId().toShortString(), job.getImage(), host)); } }
} else if (!taskStatus.getState().equals(TaskStatus.State.RUNNING)) {
? hostStatus.getState().toString() : "-";
@Override public int hashCode() { int result = host != null ? host.hashCode() : 0; result = 31 * result + (jobId != null ? jobId.hashCode() : 0); result = 31 * result + (state != null ? state.hashCode() : 0); return result; } }