private final DataStoreJobCoordinator dataStoreJobCoordinator = DataStoreJobCoordinator.getInstance();
private static Timer LogicalSwitchDeleteJobTimer = new Timer();
- private static final int LOGICAL_SWITCH_DELETE_DELAY = 120000;
+ private static final int LOGICAL_SWITCH_DELETE_DELAY = 20000;
private final ConcurrentMap<Pair<NodeId, String>, TimerTask> logicalSwitchDeletedTasks = new ConcurrentHashMap<>();
public ElanL2GatewayUtils(DataBroker broker, ItmRpcService itmRpcService, ElanUtils elanUtils,
* @return true, if successful
*/
private static boolean doesLocalUcastMacExistsInCache(L2GatewayDevice elanL2GwDevice, String macAddress) {
- java.util.Optional<LocalUcastMacs> macExistsInCache = elanL2GwDevice.getUcastLocalMacs().stream()
- .filter(mac -> mac.getMacEntryKey().getValue().equalsIgnoreCase(macAddress)).findFirst();
- return macExistsInCache.isPresent();
+ return elanL2GwDevice.getUcastLocalMacs().stream()
+ .anyMatch(mac -> mac.getMacEntryKey().getValue().equalsIgnoreCase(macAddress));
}
/**
});
if (LOG.isDebugEnabled()) {
- List<String> elanMacs = lstElanMacs.stream().map(mac -> mac.getValue()).collect(Collectors.toList());
+ List<String> elanMacs = lstElanMacs.stream().map(MacAddress::getValue).collect(Collectors.toList());
LOG.debug("Deleting elan [{}] macs from node [{}]. Deleted macs = {}", elanName, hwvtepNodeId, elanMacs);
}
return future;
WriteTransaction transaction = broker.newWriteOnlyTransaction();
for (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712
- .l2gateway.attributes.devices.Interfaces deviceInterface : hwVtepDevice
- .getInterfaces()) {
+ .l2gateway.attributes.devices.Interfaces deviceInterface : hwVtepDevice.getInterfaces()) {
NodeId physicalSwitchNodeId = HwvtepSouthboundUtils.createManagedNodeId(nodeId,
hwVtepDevice.getDeviceName());
TerminationPoint portTerminationPoint = HwvtepUtils.getPhysicalPortTerminationPoint(broker,
WriteTransaction transaction = broker.newWriteOnlyTransaction();
for (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712
- .l2gateway.attributes.devices.Interfaces deviceInterface : hwVtepDevice.getInterfaces()) {
+ .l2gateway.attributes.devices.Interfaces deviceInterface : hwVtepDevice.getInterfaces()) {
String phyPortName = deviceInterface.getInterfaceName();
if (deviceInterface.getSegmentationIds() != null && !deviceInterface.getSegmentationIds().isEmpty()) {
for (Integer vlanId : deviceInterface.getSegmentationIds()) {
public static Interface getInterfaceFromConfigDS(InterfaceKey interfaceKey, DataBroker dataBroker) {
InstanceIdentifier<Interface> interfaceId = getInterfaceIdentifier(interfaceKey);
- Optional<Interface> interfaceOptional = IfmUtil.read(LogicalDatastoreType.CONFIGURATION, interfaceId,
- dataBroker);
- if (!interfaceOptional.isPresent()) {
- return null;
- }
-
- return interfaceOptional.get();
+ return IfmUtil.read(LogicalDatastoreType.CONFIGURATION, interfaceId, dataBroker).orNull();
}
/**