Class AbstractTopologyBuilder<T extends Route>
java.lang.Object
org.opendaylight.bgpcep.bgp.topology.provider.AbstractTopologyBuilder<T>
- All Implemented Interfaces:
EventListener
,TopologyReference
,org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener<T>
,org.opendaylight.mdsal.binding.api.DataTreeChangeListener<T>
,org.opendaylight.mdsal.binding.api.TransactionChainListener
,InstanceReference<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology>
- Direct Known Subclasses:
Ipv4ReachabilityTopologyBuilder
,Ipv6ReachabilityTopologyBuilder
,LinkstateGraphBuilder
,LinkstateTopologyBuilder
public abstract class AbstractTopologyBuilder<T extends Route>
extends Object
implements org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener<T>, TopologyReference, org.opendaylight.mdsal.binding.api.TransactionChainListener
-
Field Summary
Modifier and TypeFieldDescriptionprotected @org.checkerframework.checker.lock.qual.GuardedBy({"this"}) int
protected @org.checkerframework.checker.lock.qual.GuardedBy({"this"}) long
protected boolean
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractTopologyBuilder
(org.opendaylight.mdsal.binding.api.DataBroker dataProvider, RibReference locRibReference, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId topologyId, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.TopologyTypes types, AddressFamily afi, SubsequentAddressFamily safi) protected
AbstractTopologyBuilder
(org.opendaylight.mdsal.binding.api.DataBroker dataProvider, RibReference locRibReference, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId topologyId, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.TopologyTypes types, AddressFamily afi, SubsequentAddressFamily safi, long listenerResetLimitInMillsec, int listenerResetEnforceCounter) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
final com.google.common.util.concurrent.FluentFuture<? extends org.opendaylight.mdsal.common.api.CommitInfo>
close()
protected abstract void
createObject
(org.opendaylight.mdsal.binding.api.ReadWriteTransaction trans, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> id, T value) final org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology>
Returns the InstanceIdentifier of the object.protected abstract org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T>
getRouteWildcard
(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<Tables> tablesId) void
onDataTreeChanged
(Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<T>> changes) final void
onTransactionChainFailed
(org.opendaylight.mdsal.binding.api.TransactionChain transactionChain, org.opendaylight.mdsal.binding.api.Transaction transaction, Throwable cause) final void
onTransactionChainSuccessful
(org.opendaylight.mdsal.binding.api.TransactionChain transactionChain) protected abstract void
removeObject
(org.opendaylight.mdsal.binding.api.ReadWriteTransaction trans, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> id, T value) protected void
Reset the data change listener to its initial status.protected void
Reset the transaction chain only so that the PingPong transaction chain will become usable again.protected boolean
There are a few reasons we want to schedule a listener restart in a delayed manner: 1.protected void
routeChanged
(org.opendaylight.mdsal.binding.api.DataTreeModification<T> change, org.opendaylight.mdsal.binding.api.ReadWriteTransaction trans) protected void
final void
start()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opendaylight.mdsal.binding.api.DataTreeChangeListener
onInitialData
-
Field Details
-
listenerScheduledRestartTime
protected @org.checkerframework.checker.lock.qual.GuardedBy({"this"}) long listenerScheduledRestartTime -
listenerScheduledRestartEnforceCounter
protected @org.checkerframework.checker.lock.qual.GuardedBy({"this"}) int listenerScheduledRestartEnforceCounter -
networkTopologyTransaction
protected boolean networkTopologyTransaction
-
-
Constructor Details
-
AbstractTopologyBuilder
protected AbstractTopologyBuilder(org.opendaylight.mdsal.binding.api.DataBroker dataProvider, RibReference locRibReference, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId topologyId, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.TopologyTypes types, AddressFamily afi, SubsequentAddressFamily safi, long listenerResetLimitInMillsec, int listenerResetEnforceCounter) -
AbstractTopologyBuilder
protected AbstractTopologyBuilder(org.opendaylight.mdsal.binding.api.DataBroker dataProvider, RibReference locRibReference, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId topologyId, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.TopologyTypes types, AddressFamily afi, SubsequentAddressFamily safi)
-
-
Method Details
-
start
public final void start() -
getRouteWildcard
-
createObject
-
removeObject
-
clearTopology
protected abstract void clearTopology() -
getInstanceIdentifier
public final org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology> getInstanceIdentifier()Description copied from interface:InstanceReference
Returns the InstanceIdentifier of the object.- Specified by:
getInstanceIdentifier
in interfaceInstanceReference<T extends Route>
- Returns:
- instance identifier
-
close
public final com.google.common.util.concurrent.FluentFuture<? extends org.opendaylight.mdsal.common.api.CommitInfo> close() -
onDataTreeChanged
public void onDataTreeChanged(Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<T>> changes) -
routeChanged
protected void routeChanged(org.opendaylight.mdsal.binding.api.DataTreeModification<T> change, org.opendaylight.mdsal.binding.api.ReadWriteTransaction trans) -
resetListener
protected void resetListener()Reset the data change listener to its initial status. By resetting the listener we will be able to recover all the data lost before -
resetTransactionChain
protected void resetTransactionChain()Reset the transaction chain only so that the PingPong transaction chain will become usable again. However, there will be data loss if we do not apply the previous failed transaction again -
restartTransactionChainOnDemand
protected boolean restartTransactionChainOnDemand()There are a few reasons we want to schedule a listener restart in a delayed manner: 1. we should avoid restarting the listener as when the topology is big, there might be huge overhead rebuilding the whole linkstate topology again and again 2. the #onTransactionChainFailed() normally get invoked after a delay. During that time gap, more data changes might still be pushed to #onDataTreeChanged(). And because #onTransactionChainFailed() is not invoked yet, listener restart/transaction chain restart is not done. Thus the new changes will still cause error and another #onTransactionChainFailed() might be invoked later. The listener will be restarted again in that case, which is unexpected. Restarting of transaction chain only introduce little overhead and it's okay to be restarted within a small time window. Note: when the listener is restarted, we can disregard all the incoming data changes before the restart is done, as after the listener unregister/reregister, the first #onDataTreeChanged() call will contain the a complete set of existing changes- Returns:
- if the listener get restarted, return true; otherwise false
-
scheduleListenerRestart
protected void scheduleListenerRestart() -
onTransactionChainFailed
public final void onTransactionChainFailed(org.opendaylight.mdsal.binding.api.TransactionChain transactionChain, org.opendaylight.mdsal.binding.api.Transaction transaction, Throwable cause) - Specified by:
onTransactionChainFailed
in interfaceorg.opendaylight.mdsal.binding.api.TransactionChainListener
-
onTransactionChainSuccessful
public final void onTransactionChainSuccessful(org.opendaylight.mdsal.binding.api.TransactionChain transactionChain) - Specified by:
onTransactionChainSuccessful
in interfaceorg.opendaylight.mdsal.binding.api.TransactionChainListener
-