- ConcurrentMap<String, ConcurrentMap<String, L2GatewayDevice>> cachedMap =
- (ConcurrentMap<String, ConcurrentMap<String, L2GatewayDevice>>) CacheUtil.getCache(
- ElanL2GwCacheUtils.L2GATEWAY_CONN_CACHE_NAME);
- ConcurrentMap<String, L2GatewayDevice> deviceMap = cachedMap.get(elanName);
- if (deviceMap == null) {
- synchronized (ElanL2GwCacheUtils.class) {
- deviceMap = cachedMap.computeIfAbsent(elanName, k -> new ConcurrentHashMap<>());
- }
- }
- deviceMap.put(l2GwDevice.getHwvtepNodeId(), l2GwDevice);