*/
package org.opendaylight.netvirt.elan.l2gw.utils;
-import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
+import static org.opendaylight.genius.infra.Datastore.CONFIGURATION;
import java.util.ArrayList;
import java.util.Collections;
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundUtils;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.netvirt.elan.cache.ElanInstanceCache;
import org.opendaylight.netvirt.elan.utils.Scheduler;
import org.opendaylight.netvirt.neutronvpn.api.l2gw.L2GatewayCache;
() -> {
L2GatewayDevice l2GwDevice = l2GatewayCache.get(deviceName);
NodeId globalNodeId = globalNodeIid.firstKeyOf(Node.class).getNodeId();
- Node configNode = MDSALUtil.read(broker, CONFIGURATION, globalNodeIid)
+ Node configNode = MDSALUtil.read(broker, LogicalDatastoreType.CONFIGURATION, globalNodeIid)
.or(defaultNode(globalNodeId));
- Node configPsNode = MDSALUtil.read(broker, CONFIGURATION, psNodeIid).or(defaultNode(psNodeId));
+ Node configPsNode =
+ MDSALUtil.read(broker, LogicalDatastoreType.CONFIGURATION, psNodeIid).or(defaultNode(psNodeId));
cleanupStaleLogicalSwitches(l2GwDevice, configNode, configPsNode);
cleanupTasks.remove(psNodeIid.firstKeyOf(Node.class).getNodeId());
}, getCleanupDelay(), TimeUnit.SECONDS);
final String staleLogicalSwitch) {
LOG.trace("CleanupStaleBindings for logical switch {}", staleLogicalSwitch);
- ListenableFutures.addErrorLogging(
- txRunner.callWithNewReadWriteTransactionAndSubmit(tx -> {
+ LoggingFutures.addErrorLogging(
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
if (vlans.containsKey(staleLogicalSwitch)) {
- vlans.get(staleLogicalSwitch)
- .forEach((vlanIid) -> tx.delete(LogicalDatastoreType.CONFIGURATION, vlanIid));
+ vlans.get(staleLogicalSwitch).forEach((vlanIid) -> tx.delete(vlanIid));
}
}),
LOG, "Failed to delete stale vlan bindings from node {}", globalNodeId);