use of com.hubspot.singularity.SingularityTaskShellCommandHistory in project Singularity by HubSpot.
the class TaskManager method getTaskHistory.
public Optional<SingularityTaskHistory> getTaskHistory(SingularityTaskId taskId) {
final Optional<SingularityTask> task = getTaskCheckCache(taskId, true);
if (!task.isPresent()) {
return Optional.absent();
}
List<SingularityTaskHistoryUpdate> taskUpdates = getTaskHistoryUpdates(taskId);
Optional<String> directory = getDirectory(taskId);
Optional<String> containerId = getContainerId(taskId);
List<SingularityTaskHealthcheckResult> healthchecks = getHealthcheckResults(taskId);
List<SingularityLoadBalancerUpdate> loadBalancerUpdates = Lists.newArrayListWithCapacity(2);
checkLoadBalancerHistory(loadBalancerUpdates, taskId, LoadBalancerRequestType.ADD);
checkLoadBalancerHistory(loadBalancerUpdates, taskId, LoadBalancerRequestType.REMOVE);
List<SingularityTaskShellCommandHistory> shellCommandHistory = getTaskShellCommandHistory(taskId);
List<SingularityTaskMetadata> taskMetadata = getTaskMetadata(taskId);
return Optional.of(new SingularityTaskHistory(taskUpdates, directory, containerId, healthchecks, task.get(), loadBalancerUpdates, shellCommandHistory, taskMetadata));
}
use of com.hubspot.singularity.SingularityTaskShellCommandHistory in project Singularity by HubSpot.
the class TaskManager method getTaskShellCommandHistory.
public List<SingularityTaskShellCommandHistory> getTaskShellCommandHistory(SingularityTaskId taskId) {
List<SingularityTaskShellCommandRequest> shellRequests = getTaskShellCommandRequestsForTask(taskId);
List<SingularityTaskShellCommandHistory> shellCommandHistory = new ArrayList<>(shellRequests.size());
for (SingularityTaskShellCommandRequest shellRequest : shellRequests) {
shellCommandHistory.add(new SingularityTaskShellCommandHistory(shellRequest, getTaskShellCommandUpdates(shellRequest.getId())));
}
return shellCommandHistory;
}
Aggregations