Search in sources :

Example 1 with FlowCache

use of org.openkilda.pce.cache.FlowCache in project open-kilda by telstra.

the class CacheBolt method initState.

/**
 * {@inheritDoc}
 */
@Override
public void initState(InMemoryKeyValueState<String, Cache> state) {
    this.state = state;
    networkCache = (NetworkCache) state.get(NETWORK_CACHE);
    if (networkCache == null) {
        networkCache = new NetworkCache();
        this.state.put(NETWORK_CACHE, networkCache);
    }
    flowCache = (FlowCache) state.get(FLOW_CACHE);
    if (flowCache == null) {
        flowCache = new FlowCache();
        this.state.put(FLOW_CACHE, flowCache);
    }
    cacheWarmingService = new CacheWarmingService(networkCache);
    reroutedFlows.clear();
}
Also used : FlowCache(org.openkilda.pce.cache.FlowCache) CacheWarmingService(org.openkilda.wfm.topology.cache.service.CacheWarmingService) NetworkCache(org.openkilda.pce.cache.NetworkCache)

Example 2 with FlowCache

use of org.openkilda.pce.cache.FlowCache in project open-kilda by telstra.

the class CrudBolt method initState.

/**
 * {@inheritDoc}
 */
@Override
public void initState(InMemoryKeyValueState<String, FlowCache> state) {
    this.caches = state;
    // TODO - do we have to use InMemoryKeyValue, or is there some other InMemory option?
    // The reason for the qestion .. we are only putting in one object.
    flowCache = state.get(FLOW_CACHE);
    if (flowCache == null) {
        flowCache = new FlowCache();
        this.caches.put(FLOW_CACHE, flowCache);
    }
}
Also used : FlowCache(org.openkilda.pce.cache.FlowCache)

Aggregations

FlowCache (org.openkilda.pce.cache.FlowCache)2 NetworkCache (org.openkilda.pce.cache.NetworkCache)1 CacheWarmingService (org.openkilda.wfm.topology.cache.service.CacheWarmingService)1