X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=coe%2Fimpl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetvirt%2Fcoe%2Flisteners%2FPodListener.java;h=6bd5238487b7412db7fa766cddc0e4006af87a4b;hb=refs%2Fchanges%2F13%2F73613%2F6;hp=f46c39a0d709ee3d031b81279485eac0dc8be963;hpb=1acc3ae5499a8c69c16ef836c0577e520eba978a;p=netvirt.git diff --git a/coe/impl/src/main/java/org/opendaylight/netvirt/coe/listeners/PodListener.java b/coe/impl/src/main/java/org/opendaylight/netvirt/coe/listeners/PodListener.java index f46c39a0d7..6bd5238487 100644 --- a/coe/impl/src/main/java/org/opendaylight/netvirt/coe/listeners/PodListener.java +++ b/coe/impl/src/main/java/org/opendaylight/netvirt/coe/listeners/PodListener.java @@ -8,8 +8,10 @@ package org.opendaylight.netvirt.coe.listeners; -import com.google.common.util.concurrent.ListenableFuture; +import static org.opendaylight.genius.infra.Datastore.CONFIGURATION; +import static org.opendaylight.genius.infra.Datastore.OPERATIONAL; +import com.google.common.util.concurrent.ListenableFuture; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -171,7 +173,7 @@ public class PodListener implements DataTreeChangeListener { LOG.trace("Adding Pod : {}", podInterface); String interfaceName = CoeUtils.buildInterfaceName(pods.getNetworkNS(), pods.getName()); List> futures = new ArrayList<>(); - futures.add(txRunner.callWithNewReadWriteTransactionAndSubmit(tx -> { + futures.add(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> { String nodeIp = String.valueOf(pods.getHostIpAddress().getValue()); ElanInstance elanInstance = CoeUtils.createElanInstanceForTheFirstPodInTheNetwork( pods.getNetworkNS(), nodeIp, podInterface, tx); @@ -186,7 +188,7 @@ public class PodListener implements DataTreeChangeListener { VpnInstance.Type.L3, 0, IpVersionChoice.IPV4, tx); })); if (podInterface.getIpAddress() != null) { - futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> { + futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> { CoeUtils.createPodNameToPodUuidMap(interfaceName, podsInstanceIdentifier, tx); })); } @@ -209,7 +211,7 @@ public class PodListener implements DataTreeChangeListener { public List> call() { List> futures = new ArrayList<>(); String podInterfaceName = CoeUtils.buildInterfaceName(pods.getNetworkNS(), pods.getName()); - futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> { + futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> { LOG.trace("Deleting Pod : {}", podInterfaceName); LOG.debug("Deleting VPN Interface for pod {}", podInterfaceName); CoeUtils.deleteVpnInterface(podInterfaceName, tx); @@ -221,7 +223,7 @@ public class PodListener implements DataTreeChangeListener { // TODO delete elan-instance if this is the last pod in the host // TODO delete vpn-instance if this is the last pod in the network })); - futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> { + futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> { CoeUtils.deletePodNameToPodUuidMap(podInterfaceName, tx); })); return futures;