private void logDeployExecutions(ImmutableCollection<DeployExecution> deployExecutions, String message) { if (LOG.isInfoEnabled()) { LOG.info("Found {} {} for this schema", deployExecutions.size(), message); if (LOG.isDebugEnabled()) { for (DeployExecution deployExecution : deployExecutions.toSortedListBy(new Function<DeployExecution, Long>() { @Override public Long valueOf(DeployExecution deployExecution1) { return deployExecution1.getId(); } })) { LOG.debug("Execution ID={}, Version Name={}, Deploy Time={}, Rollback={}", deployExecution.getId(), getDeployVersion(deployExecution), deployExecution.getDeployTime(), deployExecution.isRollback()); } } } }
private void logDeployExecutions(ImmutableCollection<DeployExecution> deployExecutions, String message) { if (LOG.isInfoEnabled()) { LOG.info("Found {} {} for this schema", deployExecutions.size(), message); if (LOG.isDebugEnabled()) { for (DeployExecution deployExecution : deployExecutions.toSortedListBy(new Function<DeployExecution, Long>() { @Override public Long valueOf(DeployExecution deployExecution1) { return deployExecution1.getId(); } })) { LOG.debug("Execution ID={}, Version Name={}, Deploy Time={}, Rollback={}", deployExecution.getId(), getDeployVersion(deployExecution), deployExecution.getDeployTime(), deployExecution.isRollback()); } } } }
private DeployExecution newExecution(long id, String versionName, boolean rollback) { DeployExecution exec = mock(DeployExecution.class); when(exec.getId()).thenReturn(id); when(exec.isRollback()).thenReturn(rollback); when(exec.getProductVersion()).thenReturn(versionName); return exec; } }
private Document getDocumentFromDeployExecution(DeployExecution deployExecution, boolean forUpdate) { ImmutableSet<Document> attrs = deployExecution.getAttributes().collect(new Function<DeployExecutionAttribute, Document>() { @Override public Document valueOf(DeployExecutionAttribute object) { return new Document() .append(attrNameColName, object.getName()) .append(attrValueColName, object.getValue()); } }); return new Document() .append(idColName, deployExecution.getId()) .append(requesterIdColName, deployExecution.getRequesterId()) .append(deployExecutionIdColName, deployExecution.getExecutorId()) .append(dbSchemaColName, deployExecution.getSchema()) .append(toolVersionColName, deployExecution.getToolVersion()) .append(deployTimeColName, new Date(deployExecution.getDeployTime().getTime())) .append(initCommandColName, deployExecution.isInit()) .append(rollbackCommandColName, deployExecution.isRollback()) .append(productVersionColName, deployExecution.getProductVersion()) .append(reasonColName, deployExecution.getReason()) .append("attrs", new ArrayList<>(attrs.toList())); }
private Document getDocumentFromDeployExecution(DeployExecution deployExecution, boolean forUpdate) { ImmutableSet<Document> attrs = deployExecution.getAttributes().collect(new Function<DeployExecutionAttribute, Document>() { @Override public Document valueOf(DeployExecutionAttribute object) { return new Document() .append(attrNameColName, object.getName()) .append(attrValueColName, object.getValue()); } }); return new Document() .append(idColName, deployExecution.getId()) .append(requesterIdColName, deployExecution.getRequesterId()) .append(deployExecutionIdColName, deployExecution.getExecutorId()) .append(dbSchemaColName, deployExecution.getSchema()) .append(toolVersionColName, deployExecution.getToolVersion()) .append(deployTimeColName, new Date(deployExecution.getDeployTime().getTime())) .append(initCommandColName, deployExecution.isInit()) .append(rollbackCommandColName, deployExecution.isRollback()) .append(productVersionColName, deployExecution.getProductVersion()) .append(reasonColName, deployExecution.getReason()) .append("attrs", new ArrayList<>(attrs.toList())); }
if (!currentExecution.isRollback()) { executionStack.push(currentExecution); } else {
if (!currentExecution.isRollback()) { executionStack.push(currentExecution); } else {
entry.getToolVersion() != null ? entry.getToolVersion() : "0.0.0", entry.isInit() ? 1 : 0, entry.isRollback() ? 1 : 0, entry.getRequesterId(), entry.getReason(),
entry.getToolVersion() != null ? entry.getToolVersion() : "0.0.0", entry.isInit() ? 1 : 0, entry.isRollback() ? 1 : 0, entry.getRequesterId(), entry.getReason(),