@Override public TaskStatus call() throws Exception { final HostStatus hostStatus = getOrNull(client.hostStatus(host)); if (hostStatus == null) { return null; } final TaskStatus taskStatus = hostStatus.getStatuses().get(jobId); return (taskStatus != null && taskStatus.getThrottled() == throttled) ? taskStatus : null; } });
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 Object call() throws Exception { final JobStatus jobStatus = getOrNull(client.jobStatus(jobId)); final TaskStatus taskStatus = jobStatus.getTaskStatuses().get(host); if (taskStatus.getThrottled() == FLAPPING) { return true; } final PortMapping port = taskStatus.getPorts().get("poke"); assert port.getExternalPort() != null; poke(port.getExternalPort()); return null; } });
metadata.put("jobState", taskStatus.getState()); metadata.put("previousJobStates", previousJobStates); metadata.put("throttleState", taskStatus.getThrottled()); if (taskStatus.getThrottled().equals(ThrottleState.IMAGE_MISSING)) { return opFactory.error( baseError + "due to missing Docker image " + stateInfo, metadata); if (taskStatus.getThrottled().equals(ThrottleState.IMAGE_PULL_FAILED)) { return opFactory.error( baseError + "due to failure pulling Docker image " + stateInfo,
chop(host, 30), ts != null ? ts.getState() : "UNKNOWN", ts != null ? ts.getThrottled() : "UNKNOWN"); out.printf("%-20s %-30s %-8s %s%n", chop(jobId.toShortString(), 20), chop(host, 30), ts.getState(), ts.getThrottled());
containerId = containerId == null ? "<none>" : containerId; table.row(host, format.print(timestamp), state, status.getThrottled(), containerId);
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)); } }
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); } }
containerId = containerId == null ? "<none>" : containerId; table.row(host, format.print(timestamp), state, status.getThrottled(), containerId);
chop(host, 30), ts != null ? ts.getState() : "UNKNOWN", ts != null ? ts.getThrottled() : "UNKNOWN"); out.printf("%-20s %-30s %-8s %s%n", chop(jobId.toShortString(), 20), chop(host, 30), ts.getState(), ts.getThrottled());