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