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); } }
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)); } }
hostStatus.getState().toString() : "-";
? hostStatus.getState().toString() : "-";