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
FieldsModifier and TypeFieldDescriptionprotected @org.checkerframework.checker.lock.qual.GuardedBy({"this"}) intprotected @org.checkerframework.checker.lock.qual.GuardedBy({"this"}) longprotected boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTopologyBuilder(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) protectedAbstractTopologyBuilder(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 voidfinal com.google.common.util.concurrent.FluentFuture<? extends org.opendaylight.mdsal.common.api.CommitInfo>close()protected abstract voidcreateObject(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) voidonDataTreeChanged(Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<T>> changes) final voidonTransactionChainFailed(org.opendaylight.mdsal.binding.api.TransactionChain transactionChain, org.opendaylight.mdsal.binding.api.Transaction transaction, Throwable cause) final voidonTransactionChainSuccessful(org.opendaylight.mdsal.binding.api.TransactionChain transactionChain) protected abstract voidremoveObject(org.opendaylight.mdsal.binding.api.ReadWriteTransaction trans, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> id, T value) protected voidReset the data change listener to its initial status.protected voidReset the transaction chain only so that the PingPong transaction chain will become usable again.protected booleanThere are a few reasons we want to schedule a listener restart in a delayed manner: 1.protected voidrouteChanged(org.opendaylight.mdsal.binding.api.DataTreeModification<T> change, org.opendaylight.mdsal.binding.api.ReadWriteTransaction trans) protected voidfinal voidstart()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:InstanceReferenceReturns the InstanceIdentifier of the object.- Specified by:
getInstanceIdentifierin 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:
onTransactionChainFailedin interfaceorg.opendaylight.mdsal.binding.api.TransactionChainListener
-
onTransactionChainSuccessful
public final void onTransactionChainSuccessful(org.opendaylight.mdsal.binding.api.TransactionChain transactionChain) - Specified by:
onTransactionChainSuccessfulin interfaceorg.opendaylight.mdsal.binding.api.TransactionChainListener
-