Search in sources :

Example 11 with SingularityDeployResult

use of com.hubspot.singularity.SingularityDeployResult in project Singularity by HubSpot.

the class SingularitySchedulerTestBase method finishDeploy.

protected void finishDeploy(SingularityDeployMarker marker, SingularityDeploy deploy) {
    deployManager.deletePendingDeploy(marker.getRequestId());
    deployManager.saveDeployResult(marker, Optional.of(deploy), new SingularityDeployResult(DeployState.SUCCEEDED));
    deployManager.saveNewRequestDeployState(new SingularityRequestDeployState(marker.getRequestId(), Optional.of(marker), Optional.<SingularityDeployMarker>absent()));
}
Also used : SingularityDeployResult(com.hubspot.singularity.SingularityDeployResult) SingularityDeployMarker(com.hubspot.singularity.SingularityDeployMarker) SingularityRequestDeployState(com.hubspot.singularity.SingularityRequestDeployState)

Example 12 with SingularityDeployResult

use of com.hubspot.singularity.SingularityDeployResult in project Singularity by HubSpot.

the class DeployManager method getDeployHistory.

public Optional<SingularityDeployHistory> getDeployHistory(String requestId, String deployId, boolean loadEntireHistory) {
    Optional<SingularityDeployMarker> deployMarker = getData(getDeployMarkerPath(requestId, deployId), deployMarkerTranscoder);
    if (!deployMarker.isPresent()) {
        return Optional.absent();
    }
    Optional<SingularityDeployResult> deployState = getDeployResult(requestId, deployId);
    if (!loadEntireHistory) {
        return Optional.of(new SingularityDeployHistory(deployState, deployMarker.get(), Optional.<SingularityDeploy>absent(), Optional.<SingularityDeployStatistics>absent()));
    }
    Optional<SingularityDeploy> deploy = getDeploy(requestId, deployId);
    if (!deploy.isPresent()) {
        return Optional.absent();
    }
    Optional<SingularityDeployStatistics> deployStatistics = getDeployStatistics(requestId, deployId);
    return Optional.of(new SingularityDeployHistory(deployState, deployMarker.get(), deploy, deployStatistics));
}
Also used : SingularityDeployMarker(com.hubspot.singularity.SingularityDeployMarker) SingularityDeployResult(com.hubspot.singularity.SingularityDeployResult) SingularityDeployHistory(com.hubspot.singularity.SingularityDeployHistory) SingularityDeploy(com.hubspot.singularity.SingularityDeploy) SingularityDeployStatistics(com.hubspot.singularity.SingularityDeployStatistics)

Aggregations

SingularityDeployResult (com.hubspot.singularity.SingularityDeployResult)12 SingularityRequestDeployState (com.hubspot.singularity.SingularityRequestDeployState)5 SingularityTaskId (com.hubspot.singularity.SingularityTaskId)5 SingularityDeployMarker (com.hubspot.singularity.SingularityDeployMarker)4 SingularityDeployProgress (com.hubspot.singularity.SingularityDeployProgress)4 DeployState (com.hubspot.singularity.DeployState)3 SingularityLoadBalancerUpdate (com.hubspot.singularity.SingularityLoadBalancerUpdate)3 SingularityDeploy (com.hubspot.singularity.SingularityDeploy)2 SingularityPendingRequest (com.hubspot.singularity.SingularityPendingRequest)2 ArrayList (java.util.ArrayList)2 SingularityCreateResult (com.hubspot.singularity.SingularityCreateResult)1 SingularityDeployBuilder (com.hubspot.singularity.SingularityDeployBuilder)1 SingularityDeployHistory (com.hubspot.singularity.SingularityDeployHistory)1 SingularityDeployKey (com.hubspot.singularity.SingularityDeployKey)1 SingularityDeployStatistics (com.hubspot.singularity.SingularityDeployStatistics)1 SingularityDeployUpdate (com.hubspot.singularity.SingularityDeployUpdate)1 SingularityRequest (com.hubspot.singularity.SingularityRequest)1 SingularityRequestWithState (com.hubspot.singularity.SingularityRequestWithState)1 SingularityTaskCleanup (com.hubspot.singularity.SingularityTaskCleanup)1 SingularityTaskShellCommandRequestId (com.hubspot.singularity.SingularityTaskShellCommandRequestId)1