use of com.netflix.conductor.util.Constants.TASK_DEFS_KEY in project conductor by Netflix.
the class CassandraMetadataDAO method getAllTaskDefsFromDB.
@SuppressWarnings("unchecked")
private List<TaskDef> getAllTaskDefsFromDB() {
try {
ResultSet resultSet = session.execute(selectAllTaskDefsStatement.bind(TASK_DEFS_KEY));
List<Row> rows = resultSet.all();
if (rows.size() == 0) {
LOGGER.info("No task definitions were found.");
return Collections.EMPTY_LIST;
}
return rows.stream().map(row -> readValue(row.getString(TASK_DEFINITION_KEY), TaskDef.class)).collect(Collectors.toList());
} catch (Exception e) {
Monitors.error(CLASS_NAME, "getAllTaskDefs");
String errorMsg = "Failed to get all task defs";
LOGGER.error(errorMsg, e);
throw new ApplicationException(Code.BACKEND_ERROR, errorMsg, e);
}
}
Aggregations