
com.hubspot.singularity.data.history.DeployTaskHistoryHelper Maven / Gradle / Ivy
package com.hubspot.singularity.data.history;
import java.util.List;
import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.hubspot.singularity.ExtendedTaskState;
import com.hubspot.singularity.OrderDirection;
import com.hubspot.singularity.SingularityDeployKey;
import com.hubspot.singularity.SingularityTaskId;
import com.hubspot.singularity.SingularityTaskIdHistory;
import com.hubspot.singularity.data.TaskManager;
@Singleton
public class DeployTaskHistoryHelper extends BlendedHistoryHelper {
private final TaskManager taskManager;
private final HistoryManager historyManager;
@Inject
public DeployTaskHistoryHelper(TaskManager taskManager, HistoryManager historyManager) {
this.taskManager = taskManager;
this.historyManager = historyManager;
}
@Override
protected List getFromZk(final SingularityDeployKey deployKey) {
List deployTaskIds = taskManager.getInactiveTaskIdsForDeploy(deployKey.getRequestId(), deployKey.getDeployId());
return getTaskHistoriesFor(taskManager, deployTaskIds);
}
@Override
protected List getFromHistory(final SingularityDeployKey deployKey, int historyStart, int numFromHistory) {
return historyManager.getTaskIdHistory(Optional.of(deployKey.getRequestId()), Optional.of(deployKey.getDeployId()), Optional. absent(), Optional. absent(),
Optional. absent(), Optional. absent(), Optional. absent(), Optional.of(historyStart), numFromHistory);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy