This method has a new place in LoggingFutures, use it from there.
Change-Id: I54d66f7c797ca88d8c5eed7d70c5f2ffeda3463e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepUtils;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
}
List<String> vmMacs = getAllVmMacs();
LOG.trace("Installing drop actions to this new DPN {} VMs {}", dpId, vmMacs);
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
for (String vmMacAddress : vmMacs) {
installDhcpDropAction(dpId, vmMacAddress, tx);
}
if (setOfTunnelIpElanNamePairs == null || setOfTunnelIpElanNamePairs.isEmpty()) {
LOG.trace("No tunnelIpElanName to handle for dpn {}. Returning", dpnId);
} else {
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
if (!dpnId.equals(DhcpMConstants.INVALID_DPID)) {
List<String> listOfVms = getAllVmMacs();
for (String vmMacAddress : listOfVms) {
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
//check whether any changes have happened
LOG.trace("DhcpSubnetListener installNeutronPortEntries dpId: {} vmMacAddress : {}", dpId, vmMacAddress);
//Bind the dhcp service when enabled
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> DhcpServiceUtils.bindDhcpService(interfaceName, NwConstants.DHCP_TABLE, tx)), LOG,
"Error writing to the datastore");
//install the entries
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
tx -> dhcpManager.installDhcpEntries(dpId, vmMacAddress, tx)), LOG,
"Error writing to the datastore");
}
LOG.trace("DhcpSubnetListener uninstallNeutronPortEntries dpId: {} vmMacAddress : {}",
dpId, vmMacAddress);
//Unbind the dhcp service when disabled
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> DhcpServiceUtils.unbindDhcpService(interfaceName, tx)), LOG,
"Error writing to the datastore");
//uninstall the entries
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
tx -> dhcpManager.unInstallDhcpEntries(dpId, vmMacAddress, tx)), LOG,
"Error writing to the datastore");
}
import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.serviceutils.tools.listener.AbstractAsyncDataTreeChangeListener;
try {
if (node[1] != null) {
Uint64 dpId = Uint64.valueOf(node[1]);
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
txRunner.callWithNewWriteOnlyTransactionAndSubmit(Datastore.CONFIGURATION,
tx -> dhcpManager.setupDefaultDhcpFlows(tx, dpId)),
LOG, "Error handling node addition for {}", add);
import org.opendaylight.genius.mdsalutil.matches.MatchMetadata;
import org.opendaylight.genius.utils.batching.SubTransaction;
import org.opendaylight.genius.utils.batching.SubTransactionImpl;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
@Nullable List<InstructionInfo> instructions, int addOrRemove,
WriteTransaction tx, @Nullable List<SubTransaction> subTxns) {
if (tx == null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
newTx -> makeConnectedRoute(dpId, vpnId, vrfEntry, rd, instructions, addOrRemove, newTx, subTxns)),
LOG, "Error making connected route");
return;
final VrfEntry vrfEntry, Optional<Routes> extraRouteOptional,
@Nullable WriteTransaction tx) {
if (tx == null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
newTx -> deleteRemoteRoute(localDpnId, remoteDpnId, vpnId, vrfTableKey, vrfEntry,
extraRouteOptional, newTx)), LOG, "Error deleting remote route");
return;
import org.opendaylight.genius.utils.batching.ResourceBatchingManager;
import org.opendaylight.genius.utils.batching.ResourceHandler;
import org.opendaylight.genius.utils.batching.SubTransaction;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
WriteTransaction tx,
List<SubTransaction> subTxns) {
if (tx == null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
newTx -> createRemoteFibEntry(remoteDpnId, vpnId, rd, vrfEntry, newTx, subTxns)), LOG,
"Error creating remote FIB entry");
return;
final VrfEntry vrfEntry, Optional<Routes> extraRouteOptional,
@Nullable WriteTransaction tx, List<SubTransaction> subTxns) {
if (tx == null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
newTx -> deleteRemoteRoute(localDpnId, remoteDpnId, vpnId, vrfTableKey, vrfEntry,
extraRouteOptional, newTx)), LOG, "Error deleting remote route");
return;
import org.opendaylight.genius.utils.batching.SubTransaction;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.elanmanager.api.IElanService;
void installSubnetRouteInFib(final Uint64 dpnId, final long elanTag, final String rd,
final Uint32 vpnId, final VrfEntry vrfEntry, TypedWriteTransaction<Configuration> tx) {
if (tx == null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
newTx -> installSubnetRouteInFib(dpnId, elanTag, rd, vpnId, vrfEntry, newTx)), LOG,
"Error installing subnet route in FIB");
return;
private void createRemoteFibEntry(final Uint64 remoteDpnId, final Uint32 vpnId, String rd,
final VrfEntry vrfEntry, TypedWriteTransaction<Configuration> tx) {
if (tx == null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
newTx -> createRemoteFibEntry(remoteDpnId, vpnId, rd, vrfEntry, newTx)), LOG,
"Error creating remote FIB entry");
return;
private void makeLFibTableEntry(Uint64 dpId, Uint32 label, @Nullable List<InstructionInfo> instructions,
int priority, int addOrRemove, TypedWriteTransaction<Configuration> tx) {
if (tx == null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
newTx -> makeLFibTableEntry(dpId, label, instructions, priority, addOrRemove, newTx)), LOG,
"Error making LFIB table entry");
return;
optLabel.ifPresent(label -> {
LOG.trace("Removing flow in FIB table for interVpnLink {}", interVpnLinkName);
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
for (Uint64 dpId : targetDpns) {
LOG.debug("Removing flow: VrfEntry=[prefix={} label={}] dpn {} for InterVpnLink {} in LFIB",
vrfEntry.getDestPrefix(), label, dpId, interVpnLinkName);
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.netvirt.elanmanager.api.IElanService;
import org.opendaylight.netvirt.ipv6service.api.ElementCache;
intf.getIntfUUID(), ndTargetAddr);
//NITHI
- //ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(Datastore.CONFIGURATION,
+ //LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(Datastore.CONFIGURATION,
tx -> {
/*Exact VM vNIC interface IPv6 and MAC address match flow */
ipv6ServiceUtils.instIcmpv6NsMatchFlow(NwConstants.IPV6_TABLE, dpnId,
return;
}
Long elanTag = getNetworkElanTag(routerPort.getNetworkID());
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(Datastore.CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(Datastore.CONFIGURATION,
tx -> {
ipv6ServiceUtils.installIcmpv6NsDefaultPuntFlow(NwConstants.IPV6_TABLE,
dpnIfaceInfo.getDpId(), elanTag, ndTarget,
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.infra.TypedReadWriteTransaction;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.natservice.api.SnatServiceManager;
Uint64 primarySwitchId = routerToNaptSwitch.getPrimarySwitchId();
Routers router = natDataUtil.getRouter(routerToNaptSwitch.getRouterName());
if (router != null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
confTx -> snatServiceManger.notify(confTx, router, null, primarySwitchId, null,
SnatServiceManager.Action.SNAT_ALL_SWITCH_DISBL)), LOG,
"error handling SNAT centralized switch removal");
}
Uint64 origPrimarySwitchId = origRouterToNaptSwitch.getPrimarySwitchId();
Uint64 updatedPrimarySwitchId = updatedRouterToNaptSwitch.getPrimarySwitchId();
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, confTx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, confTx -> {
Routers origRouter = NatUtil.getRoutersFromConfigDS(confTx, origRouterToNaptSwitch.getRouterName());
Routers updatedRouter = NatUtil.getRoutersFromConfigDS(confTx, updatedRouterToNaptSwitch.getRouterName());
if (!Objects.equals(origPrimarySwitchId, updatedPrimarySwitchId)) {
LOG.warn("VpnId not unavailable for router {} yet", routerName);
eventCallbacks.onAddOrUpdate(LogicalDatastoreType.CONFIGURATION,
NatUtil.getVpnInstanceToVpnIdIdentifier(routerName), (unused, newVpnId) -> {
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
innerConfTx -> handleAdd(innerConfTx, routerName, router, primarySwitchId,
isEnableSnat)), LOG,
}, Duration.ofSeconds(5), iid -> LOG.error("VpnId not found for router {}", routerName));
return;
}
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
confTx -> handleAdd(confTx, routerName, router, primarySwitchId,
isEnableSnat)), LOG, "Error handling router addition");
import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
}
return NatUtil.getPrimaryRd(routerName, tx);
}).get();
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(OPERATIONAL, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(OPERATIONAL, tx -> {
for (Uuid subnetUuid : addedSubnetIds) {
Subnetmap subnetMapEntry = subnetMapEntries.get(subnetUuid);
Uuid routerPortUuid = subnetMapEntry.getRouterInterfacePortId();
try {
String primaryRd = txRunner.applyWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
tx -> NatUtil.getPrimaryRd(routerName, tx)).get();
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(OPERATIONAL, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(OPERATIONAL, tx -> {
for (Uuid subnetUuid : deletedSubnetIds) {
String routerPort = subnetIdToRouterPortMap.remove(subnetUuid.getValue());
if (routerPort == null) {
import org.opendaylight.genius.mdsalutil.matches.MatchIpv4Destination;
import org.opendaylight.genius.mdsalutil.matches.MatchMetadata;
import org.opendaylight.genius.mdsalutil.matches.MatchTunnelId;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
eventCallbacks.onAddOrUpdate(LogicalDatastoreType.CONFIGURATION,
NatUtil.getGroupInstanceId(dpnId, groupId), (unused, newGroupId) -> {
LOG.info("group {} is created in the config", groupId);
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
innerConfTx -> addSnatMissFlowForGroup(innerConfTx, dpnId, routerId, groupId)),
LOG, "Error adding flow for the group {}",groupId);
import org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.genius.mdsalutil.matches.MatchTunnelId;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.bgpmanager.api.IBgpManager;
LOG.debug("onAddFloatingIp : Add Floating Ip {} , found associated to fixed port {}",
externalIp, interfaceName);
if (floatingIpPortMacAddress != null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
vpnManager.addSubnetMacIntoVpnInstance(vpnName, null, floatingIpPortMacAddress, dpnId, tx);
vpnManager.addArpResponderFlowsToExternalNetworkIps(routerName,
Collections.singleton(externalIp),
@Override
public void onSuccess(@NonNull RpcResult<CreateFibEntryOutput> result) {
if (result.isSuccessful()) {
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, innerConfTx -> {
LOG.info("onAddFloatingIp : Successfully installed custom FIB routes for Floating "
+ "IP Prefix {} on DPN {}", externalIp, dpnId);
SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(dataBroker,
LogicalDatastoreType.CONFIGURATION, vpnIfIdentifier);
if (optionalVpnInterface.isPresent()) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> {
for (VpnInstanceNames vpnInstance : optionalVpnInterface.get().nonnullVpnInstanceNames().values()) {
if (!vpnName.equals(vpnInstance.getVpnName())) {
continue;
@Override
public void onSuccess(@NonNull RpcResult<RemoveFibEntryOutput> result) {
if (result.isSuccessful()) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
innerConfTx -> {
LOG.info("onRemoveFloatingIp : Successfully removed custom FIB routes for Floating "
+ "IP Prefix {} on DPN {}", externalIp, dpnId);
SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(dataBroker,
LogicalDatastoreType.CONFIGURATION, vpnIfIdentifier);
if (optionalVpnInterface.isPresent()) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> {
for (VpnInstanceNames vpnInstance : optionalVpnInterface.get().nonnullVpnInstanceNames().values()) {
if (!vpnName.equals(vpnInstance.getVpnName())) {
continue;
import org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.genius.mdsalutil.matches.MatchTunnelId;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.netvirt.bgpmanager.api.IBgpManager;
import org.opendaylight.netvirt.fibmanager.api.IFibManager;
@Override
public void onSuccess(@NonNull RpcResult<RemoveFibEntryOutput> result) {
if (result.isSuccessful()) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
innerConfTx -> {
LOG.info("evpnDelFibTsAndReverseTraffic : Successfully removed custom FIB routes for "
+ "External Fixed IP {} on DPN {} with l3Vni {}, ExternalVpnName {} for "
import org.opendaylight.genius.mdsalutil.matches.MatchMetadata;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.natservice.api.CentralizedSwitchScheduler;
@Nullable TypedReadWriteTransaction<Configuration> confTx, boolean create)
throws ExecutionException, InterruptedException {
if (confTx == null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
newTx -> addOrDelDefaultFibRouteForDnat(dpnId, routerName, routerId, newTx, create)), LOG,
"Error handling default FIB route for DNAT");
return;
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.serviceutils.tools.listener.AbstractAsyncDataTreeChangeListener;
final ReentrantLock lock = NatUtil.lockForNat(dpId);
lock.lock();
try {
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(OPERATIONAL,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(OPERATIONAL,
operTx -> {
NatUtil.addToNeutronRouterDpnsMap(routerId, interfaceName, dpId, operTx);
NatUtil.addToDpnRoutersMap(routerId, interfaceName, dpId, operTx);
NatUtil.removeSnatEntriesForPort(dataBroker, naptManager, mdsalManager, neutronVpnService,
interfaceName, routerId);
}
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
txRunner.callWithNewReadWriteTransactionAndSubmit(OPERATIONAL, operTx -> {
//Delete the NeutronRouterDpnMap from the ODL:L3VPN operational model
NatUtil
interfaceManager, operTx);
}), LOG, "Error handling NAT router interface removal");
//Delete the RouterInterfaces maintained in the ODL:L3VPN configuration model
- ListenableFutures
- .addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
confTx -> confTx.delete(NatUtil.getRouterInterfaceId(interfaceName))), LOG,
"Error handling NAT router interface removal");
} finally {
import org.opendaylight.genius.mdsalutil.matches.MatchEthernetType;
import org.opendaylight.genius.mdsalutil.matches.MatchMetadata;
import org.opendaylight.genius.utils.JvmGlobalLocks;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
public static void installRouterGwFlows(ManagedNewTransactionRunner txRunner, IVpnManager vpnManager,
Routers router, Uint64 primarySwitchId, int addOrRemove) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
Map<ExternalIpsKey, ExternalIps> keyExternalIpsMap = router.getExternalIps();
List<String> externalIpsSting = new ArrayList<>();
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.natservice.api.SnatServiceManager;
LOG.debug("Skipping the notification recived for NAPT switch {}", routerUuid);
return;
}
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
confTx -> {
natServiceManager.notify(confTx, router, null, naptSwitch, dpnId,
SnatServiceManager.Action.CNT_ROUTER_ENBL);
LOG.debug("Skipping the notification recived for NAPT switch {}", routerUuid);
return;
}
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
confTx -> {
natServiceManager.notify(confTx, router, null, naptSwitch, dpnId,
SnatServiceManager.Action.CNT_ROUTER_DISBL);
import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.natservice.api.CentralizedSwitchScheduler;
}
if (!Objects.equals(original.getSubnetIds(), update.getSubnetIds())
|| !Objects.equals(original.getExternalIps(), update.getExternalIps())) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
confTx -> natServiceManager.notify(confTx, update, original, null, null,
SnatServiceManager.Action.SNAT_ROUTER_UPDATE)), LOG,
"error handling external router update");
import org.opendaylight.genius.mdsalutil.matches.MatchEthernetType;
import org.opendaylight.genius.mdsalutil.matches.MatchMplsLabel;
import org.opendaylight.genius.mdsalutil.matches.MatchTunnelId;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
customInstructions.add(new InstructionApplyActions(actionInfoFib).buildInstruction(0));
customInstructions.add(new InstructionGotoTable(NwConstants.PDNAT_TABLE).buildInstruction(1));
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
innerConfTx -> {
makeTunnelTableEntry(vpnName, dpnId, label, instructions, innerConfTx, provType);
makeLFibTableEntry(dpnId, label, floatingIpPortMacAddress, NwConstants.PDNAT_TABLE,
return;
}
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
String networkVpnName = NatUtil.getAssociatedVPN(tx, networkId);
vpnManager.removeSubnetMacFromVpnInstance(networkVpnName, subnetId.getValue(), floatingIpPortMacAddress,
dpnId, tx);
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.ReadFailedException;
LOG.warn("update: Interface {} is not present", portName);
}
});
- ListenableFutures.addErrorLogging(future, LOG,
+ LoggingFutures.addErrorLogging(future, LOG,
"update: Failed to update interface {} with networkId {}", portName, network);
return Collections.singletonList(future);
});
nvpnNatManager.handleSubnetsForExternalRouter(routerId);
return Collections.emptyList();
});
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
confTx -> {
String portInterfaceName = createOfPortInterface(routerPort, confTx);
createElanInterface(routerPort, portInterfaceName, confTx);
nvpnManager.deleteVpnInterface(routerPort.getUuid().getValue(),
null /* vpn-id */, null /* wrtConfigTxn*/);
// update RouterInterfaces map
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
confTx -> {
IpVersionChoice ipVersion = IpVersionChoice.UNDEFINED;
for (FixedIps portIP : keyFixedIpsMap.values()) {
}
}
});
- ListenableFutures.addErrorLogging(future, LOG,
+ LoggingFutures.addErrorLogging(future, LOG,
"handleNeutronPortCreated: Failed for port {} with networkId {}", portName, networkId);
return Collections.singletonList(future);
});
//dissociate fixedIP from floatingIP if associated
nvpnManager.dissociatefixedIPFromFloatingIP(port.getUuid().getValue());
});
- ListenableFutures.addErrorLogging(future, LOG,
+ LoggingFutures.addErrorLogging(future, LOG,
"handleNeutronPortDeleted: Failed to update interface {} with networkId", portName,
port.getNetworkId().getValue());
return Collections.singletonList(future);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netvirt.neutronvpn;
import com.google.common.util.concurrent.JdkFutureAdapters;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.genius.arputil.api.ArpConstants;
import org.opendaylight.genius.mdsalutil.NWUtil;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.netvirt.elanmanager.api.IElanService;
import org.opendaylight.netvirt.vpnmanager.api.ICentralizedSwitchProvider;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
SendArpRequestInput sendArpRequestInput = new SendArpRequestInputBuilder().setIpaddress(dstIpAddress)
.setInterfaceAddress(Collections.singletonList(interfaceAddress)).build();
- ListenableFutures.addErrorLogging(JdkFutureAdapters.listenInPoolThread(
+ LoggingFutures.addErrorLogging(JdkFutureAdapters.listenInPoolThread(
arpUtilService.sendArpRequest(sendArpRequestInput)), LOG, "Send ARP request");
} catch (Exception e) {
LOG.error("Failed to send ARP request to external GW {} from interface {}",
import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.genius.utils.JvmGlobalLocks;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.infrautils.utils.concurrent.NamedLocks;
import org.opendaylight.infrautils.utils.concurrent.NamedSimpleReentrantLock.AcquireResult;
import org.opendaylight.mdsal.binding.api.DataBroker;
protected void deleteVpnInterface(String infName, @Nullable String vpnId,
@Nullable TypedWriteTransaction<Configuration> wrtConfigTxn) {
if (wrtConfigTxn == null) {
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> deleteVpnInterface(infName, vpnId, tx)),
LOG, "Error deleting VPN interface {} {}", infName, vpnId);
}
}
});
- ListenableFutures.addErrorLogging(future, LOG,
+ LoggingFutures.addErrorLogging(future, LOG,
"addSubnetToVpn: Failed while creating VPN interface for vpnId {}, portId {}"
+ "{}, subnetId {}", vpnId.getValue(), portId, subnet.getValue());
return Collections.singletonList(future);
subnetId.getValue());
}
});
- ListenableFutures.addErrorLogging(future, LOG,
+ LoggingFutures.addErrorLogging(future, LOG,
"removeSubnetFromVpn: Exception while processing deletion of VPN interfaces for port {}"
+ " belonging to subnet {} and vpnId {}",
portId.getValue(), subnetId.getValue(), vpnId.getValue());
.setVpnInstanceName(vpnName.getValue())
.build();
- ListenableFutures.addErrorLogging(JdkFutureAdapters.listenInPoolThread(
+ LoggingFutures.addErrorLogging(JdkFutureAdapters.listenInPoolThread(
vpnRpcService.removeStaticRoute(rpcInput)), LOG, "Remove VPN routes");
} else {
// Any other case is a fault.
return;
}
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
for (String elanInterface : extElanInterfaces) {
createExternalVpnInterface(extNetId, elanInterface, tx);
}
LOG.error("No external ports attached for external network {}", extNetId.getValue());
return;
}
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
for (String elanInterface : extElanInterfaces) {
InstanceIdentifier<VpnInterface> vpnIfIdentifier = NeutronvpnUtils
.buildVpnInterfaceIdentifier(elanInterface);
return;
}
if (wrtConfigTxn == null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> writeVpnInterfaceToDs(vpnIdList, infName, adjacencies, networkUuid, isRouterInterface, tx)), LOG,
"Error writing VPN interface");
return;
}
if (wrtConfigTxn == null) {
LOG.error("updateVpnInterfaceWithAdjancies called with wrtConfigTxn as null");
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
updateVpnInterfaceWithAdjacencies(vpnId, infName, adjacencies, tx);
}), LOG, "Error updating VPN interface with adjacencies");
return;
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.genius.utils.JvmGlobalLocks;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
}
VpnInstanceOpDataEntryBuilder builder = new VpnInstanceOpDataEntryBuilder(vpnInstanceOpDataEntry);
builder.setBgpvpnType(choice);
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> {
tx.merge(id, builder.build());
LOG.debug("updateVpnInstanceOpWithType: sent merge to operDS BgpvpnType {} for {}", choice, vpn.getValue());
}), LOG, "Error updating VPN instance op {} with type {}", vpn, choice);
import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.elanmanager.api.ElanHelper;
public void updateElanWithVpnInfo(String elanInstanceName, VpnInstance vpnInstance, Operation operation) {
String vpnName = vpnInstance.getVpnInstanceName();
InstanceIdentifier<ElanInstance> elanIid = ElanHelper.getElanInstanceConfigurationDataPath(elanInstanceName);
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
Optional<ElanInstance> elanInstanceOptional =
tx.read(elanIid).get();
if (!elanInstanceOptional.isPresent()) {
import org.opendaylight.genius.interfacemanager.globals.IfmConstants;
import org.opendaylight.genius.interfacemanager.globals.InterfaceInfo;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetNodeConnectorStatisticsInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetNodeConnectorStatisticsOutput;
.setQosAlertPollInterval(alertPollInterval)
.build();
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> tx.mergeParentStructurePut(path,
qosAlertConfig)), LOG, "Error writing to the config data store");
}
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.qosservice.recovery.QosServiceRecoveryHandler;
qrtBuilder.setRuleTypes(value);
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> {
InstanceIdentifier instanceIdentifier = InstanceIdentifier.create(Neutron.class).child(QosRuleTypes.class);
tx.merge(instanceIdentifier, qrtBuilder.build());
}), LOG, "Error setting up supported QoS rule types");
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.genius.mdsalutil.MatchInfoBase;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
String requestKey = String.valueOf(intRequestKey);
SettableFuture<RpcResult<AcquireElementCountersRequestHandlerOutput>> result = SettableFuture.create();
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
txRunner.callWithNewReadWriteTransactionAndSubmit(transaction -> {
if (input.getIncomingTraffic() != null) {
Optional<EgressElementCountersRequestConfig> eecrcOpt =
.child(CounterRequests.class, new CounterRequestsKey(input.getHandler())).build();
SettableFuture<RpcResult<ReleaseElementCountersRequestHandlerOutput>> result = SettableFuture.create();
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(tx -> {
Optional<IngressElementCountersRequestConfig> iecrcOpt =
tx.read(LogicalDatastoreType.CONFIGURATION, CountersServiceUtils.IECRC_IDENTIFIER).get();
Optional<EgressElementCountersRequestConfig> eecrcOpt =
}
private void deleteCounterRequest(CounterRequests counterRequest, ElementCountersDirection direction) {
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
if (ElementCountersDirection.INGRESS.equals(direction)) {
tx.delete(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier
}
private void initializeCountrsConfigDataSrore() {
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
txRunner.callWithNewReadWriteTransactionAndSubmit(transaction -> {
Optional<IngressElementCountersRequestConfig> iecrcOpt =
transaction.read(LogicalDatastoreType.CONFIGURATION,
import org.opendaylight.genius.infra.TypedReadWriteTransaction;
import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.vpnmanager.api.IVpnManager;
@Override
public void remove(InstanceIdentifier<RouterToNaptSwitch> key, RouterToNaptSwitch routerToNaptSwitch) {
LOG.debug("Removing {}", routerToNaptSwitch);
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx ->
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx ->
setupRouterGwFlows(routerToNaptSwitch, tx, NwConstants.DEL_FLOW)), LOG,
"Error processing switch removal for {}", routerToNaptSwitch);
}
LOG.debug("Updating old {} new {}", origRouterToNaptSwitch, updatedRouterToNaptSwitch);
if (!Objects.equals(updatedRouterToNaptSwitch.getPrimarySwitchId(),
origRouterToNaptSwitch.getPrimarySwitchId())) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
setupRouterGwFlows(origRouterToNaptSwitch, tx, NwConstants.DEL_FLOW);
setupRouterGwFlows(updatedRouterToNaptSwitch, tx, NwConstants.ADD_FLOW);
}), LOG, "Error updating switch {} to {}", origRouterToNaptSwitch, updatedRouterToNaptSwitch);
@Override
public void add(InstanceIdentifier<RouterToNaptSwitch> key, RouterToNaptSwitch routerToNaptSwitch) {
LOG.debug("Adding {}", routerToNaptSwitch);
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx ->
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx ->
setupRouterGwFlows(routerToNaptSwitch, tx, NwConstants.ADD_FLOW)), LOG,
"Error processing switch addition for {}", routerToNaptSwitch);
}
import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.serviceutils.tools.listener.AbstractAsyncDataTreeChangeListener;
routeIds.add(label);
}
});
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx ->
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx ->
tx.put(VpnUtil.getVpnInstanceOpDataIdentifier(rd),
new VpnInstanceOpDataEntryBuilder(vpnInstanceOpData).setRouteEntryId(routeIds)
.build())),
} else {
LOG.debug("Removing label from vpn info - {}", labels);
routeIds.removeAll(labels);
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx ->
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx ->
tx.put(VpnUtil.getVpnInstanceOpDataIdentifier(rd),
new VpnInstanceOpDataEntryBuilder(vpnInstanceOpData).setRouteEntryId(routeIds)
.build())),
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.utils.JvmGlobalLocks;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.vpnmanager.api.IVpnManager;
protected long getElanTag(String elanInstanceName) {
final long[] elanTag = {0L};
- ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(tx -> {
+ LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(tx -> {
InstanceIdentifier<ElanInstance> elanIdentifierId = InstanceIdentifier.builder(ElanInstances.class)
.child(ElanInstance.class, new ElanInstanceKey(elanInstanceName)).build();
ElanInstance elanInstance = tx.read(LogicalDatastoreType.CONFIGURATION, elanIdentifierId)
import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.elanmanager.api.IElanService;
}
InstanceIdentifier<VpnInterface> vpnInterfaceIdentifier = VpnUtil.getVpnInterfaceIdentifier(interfaceName);
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
tx.delete(vpnInterfaceIdentifier)), LOG, "Error removing VPN interface {}", vpnInterfaceIdentifier);
LOG.info("remove: Removed VPN interface {}", interfaceName);
}
import org.opendaylight.genius.utils.SystemPropertyReader;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.fibmanager.api.IFibManager;
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, confTx -> {
ListenableFuture<Void> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, operTx ->
addVpnInstance(vpnInstance, confTx, operTx));
- ListenableFutures.addErrorLogging(future, LOG, "{} call: error creating VPN {} rd {}",
+ LoggingFutures.addErrorLogging(future, LOG, "{} call: error creating VPN {} rd {}",
LOGGING_PREFIX_ADD, vpnInstance.getVpnInstanceName(),
vpnInstance.getRouteDistinguisher());
futures.add(future);
private void addVpnInstance(VpnInstance value, TypedWriteTransaction<Configuration> writeConfigTxn,
TypedWriteTransaction<Operational> writeOperTxn) {
if (writeConfigTxn == null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
addVpnInstance(value, tx, writeOperTxn)), LOG, "Error adding VPN instance {}", value);
return;
}
if (writeOperTxn == null) {
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx ->
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx ->
addVpnInstance(value, writeConfigTxn, tx)), LOG, "Error adding VPN instance {}", value);
return;
}
import org.opendaylight.infrautils.caches.CacheProvider;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
LOG.info("addVpnInterface: Router interface {} for vpn {} on dpn {}", interfaceName,
vpnName, vpnInterface.getDpnId());
});
- ListenableFutures.addErrorLogging(future, LOG,
+ LoggingFutures.addErrorLogging(future, LOG,
"Error creating FIB entry for interface {} on VPN {}", vpnInterface.getName(), vpnName);
return Collections.singletonList(future);
});
for (VpnInstanceOpDataEntry vpn : vpnsToExportRoute) {
List<VrfEntry> vrfEntries = vpnUtil.getAllVrfEntries(vpn.getVrfId());
if (vrfEntries != null) {
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, confTx -> {
for (VrfEntry vrfEntry : vrfEntries) {
try {
deleteFibEntryForRouterInterface(vpnInterface, confTx, vpnName);
LOG.info("remove: Router interface {} for vpn {}", interfaceName, vpnName);
});
- ListenableFutures.addErrorLogging(future, LOG, "Error removing call for interface {} on VPN {}",
+ LoggingFutures.addErrorLogging(future, LOG, "Error removing call for interface {} on VPN {}",
vpnInterface.getName(), vpnName);
return Collections.singletonList(future);
}, DJC_MAX_RETRIES);
MoreExecutors.directExecutor());
futures.add(configTxFuture);
for (ListenableFuture<Void> future : futures) {
- ListenableFutures.addErrorLogging(future, LOG, "update: failed for interface {} on vpn {}",
+ LoggingFutures.addErrorLogging(future, LOG, "update: failed for interface {} on vpn {}",
update.getName(), update.getVpnInstanceNames());
}
} else {
import org.opendaylight.genius.utils.ServiceIndex;
import org.opendaylight.genius.utils.SystemPropertyReader;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
Optional<VrfTables> vrfTablesOpc = read(LogicalDatastoreType.CONFIGURATION, vpnVrfTableIid);
if (vrfTablesOpc.isPresent()) {
VrfTables vrfTables = vrfTablesOpc.get();
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
new ManagedNewTransactionRunnerImpl(dataBroker).callWithNewWriteOnlyTransactionAndSubmit(
Datastore.CONFIGURATION, tx -> {
for (VrfEntry vrfEntry : vrfTables.nonnullVrfEntry().values()) {
public void removeVrfEntries(String rd, List<VrfEntry> vrfEntries) {
InstanceIdentifier<VrfTables> vpnVrfTableIid =
InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)).build();
- ListenableFutures.addErrorLogging(
+ LoggingFutures.addErrorLogging(
new ManagedNewTransactionRunnerImpl(dataBroker).callWithNewWriteOnlyTransactionAndSubmit(
Datastore.CONFIGURATION, tx -> {
for (VrfEntry vrfEntry : vrfEntries) {
import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.mdsalutil.NwConstants;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.netvirt.bgpmanager.api.IBgpManager;
.child(VrfTables.class, new VrfTablesKey(dstVpnRd))
.child(VrfEntry.class, new VrfEntryKey(newVrfEntry.getDestPrefix()))
.build();
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
tx.put(newVrfEntryIid, newVrfEntry)), LOG, "Error adding VRF entry {}", newVrfEntry);
// Finally, route is advertised it to the DC-GW. But while in the FibEntries the nexthop is the other
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
// Removing the InterVpnLinkState
InstanceIdentifier<InterVpnLinkState> interVpnLinkStateIid =
InterVpnLinkUtil.getInterVpnLinkStateIid(del.getName());
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
tx.delete(interVpnLinkStateIid)), LOG, "Error deleting inter-VPN link state {}", interVpnLinkStateIid);
}
new InterVpnLinkStateBuilder(vpnLinkState).setState(InterVpnLinkState.State.Error)
.setErrorDescription(errorMsg)
.build();
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx ->
tx.mergeParentStructurePut(vpnLinkStateIid, vpnLinkErrorState)),
LOG, "Error storing the VPN link error state for {}, {}", vpnLinkStateIid, vpnLinkErrorState);
import org.opendaylight.genius.infra.Datastore;
import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.netvirt.vpnmanager.VpnUtil;
import org.opendaylight.netvirt.vpnmanager.iplearn.model.MacEntry;
vpnUtil.removeVpnPortFixedIpToPort(dataBroker, macEntry.getVpnName(),
macEntry.getIpAddress().getHostAddress(), null);
- ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
Datastore.CONFIGURATION, tx -> vpnUtil.removeMipAdjacency(macEntry.getVpnName(),
macEntry.getInterfaceName(), macEntry.getIpAddress().getHostAddress(), tx)),
LOG, "ArpMonitorStopTask: Error writing to datastore for Vpn {} IP {}",
package org.opendaylight.netvirt.vpnmanager.populator.impl;
import static org.opendaylight.genius.infra.Datastore.OPERATIONAL;
-import static org.opendaylight.infrautils.utils.concurrent.ListenableFutures.addErrorLogging;
+import static org.opendaylight.infrautils.utils.concurrent.LoggingFutures.addErrorLogging;
import com.google.common.base.Preconditions;
import java.util.Collections;