Search in sources :

Example 1 with FlowCookieException

use of org.openkilda.wfm.topology.FlowCookieException in project open-kilda by telstra.

the class FlowMetricGenBolt method warmCookieMap.

/**
 * Pre-Populate the cookieMap from Neo4J
 */
@SuppressWarnings("unchecked")
private void warmCookieMap() {
    Iterator<Map<String, Object>> result;
    try {
        result = cypher.query(GET_ALL_FLOWS, null);
    } catch (ClientException e) {
        LOGGER.error("Error warming cookieMap", e);
        return;
    }
    while (result.hasNext()) {
        Map<String, Object> row = result.next();
        FlowResult flow;
        try {
            flow = new FlowResult(row);
            cookieMap.put(flow.getCookie(), flow);
            LOGGER.debug("added entry to cookieMap: {}", flow.toString());
        } catch (FlowCookieException e) {
            LOGGER.error("error processing cookie", e);
        }
    }
}
Also used : FlowResult(org.openkilda.wfm.topology.stats.FlowResult) FlowCookieException(org.openkilda.wfm.topology.FlowCookieException) ClientException(org.neo4j.driver.v1.exceptions.ClientException)

Aggregations

ClientException (org.neo4j.driver.v1.exceptions.ClientException)1 FlowCookieException (org.openkilda.wfm.topology.FlowCookieException)1 FlowResult (org.openkilda.wfm.topology.stats.FlowResult)1