use of com.netflix.conductor.util.Constants.TOTAL_TASKS_KEY in project conductor by Netflix.
the class CassandraExecutionDAO method getWorkflowMetadata.
@VisibleForTesting
WorkflowMetadata getWorkflowMetadata(String workflowId) {
ResultSet resultSet = session.execute(selectTotalStatement.bind(UUID.fromString(workflowId)));
recordCassandraDaoRequests("getWorkflowMetadata");
return Optional.ofNullable(resultSet.one()).map(row -> {
WorkflowMetadata workflowMetadata = new WorkflowMetadata();
workflowMetadata.setTotalTasks(row.getInt(TOTAL_TASKS_KEY));
workflowMetadata.setTotalPartitions(row.getInt(TOTAL_PARTITIONS_KEY));
return workflowMetadata;
}).orElseThrow(() -> new ApplicationException(Code.NOT_FOUND, String.format("Workflow with id: %s not found in data store", workflowId)));
}
Aggregations