@Override public SingularityDeployHistory map(int index, ResultSet r, StatementContext ctx) throws SQLException { SingularityDeployMarker marker = new SingularityDeployMarker(r.getString("requestId"), r.getString("deployId"), r.getTimestamp("createdAt").getTime(), Optional.fromNullable(r.getString(userColumn)), Optional.fromNullable(r.getString("message"))); SingularityDeployResult deployState = new SingularityDeployResult(DeployState.valueOf(r.getString("deployState")), Optional.<String>absent(), Optional.<SingularityLoadBalancerUpdate>absent(), Collections.<SingularityDeployFailure>emptyList(), r.getTimestamp("deployStateAt") .getTime()); return new SingularityDeployHistory(Optional.of(deployState), marker, Optional.<SingularityDeploy>absent(), Optional.<SingularityDeployStatistics>absent()); } }
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)); }
@Override public SingularityDeployHistory map(int index, ResultSet r, StatementContext ctx) throws SQLException { SingularityDeployMarker marker = new SingularityDeployMarker(r.getString("requestId"), r.getString("deployId"), r.getTimestamp("createdAt").getTime(), Optional.fromNullable(r.getString(userColumn)), Optional.fromNullable(r.getString("message"))); SingularityDeployResult deployState = new SingularityDeployResult(DeployState.valueOf(r.getString("deployState")), Optional.<String>absent(), Optional.<SingularityLoadBalancerUpdate>absent(), Collections.<SingularityDeployFailure>emptyList(), r.getTimestamp("deployStateAt") .getTime()); return new SingularityDeployHistory(Optional.of(deployState), marker, Optional.<SingularityDeploy>absent(), Optional.<SingularityDeployStatistics>absent()); } }
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)); }