Class AbstractTopologyBuilder<T extends Route>

java.lang.Object
org.opendaylight.bgpcep.bgp.topology.provider.AbstractTopologyBuilder<T>
All Implemented Interfaces:
com.google.common.util.concurrent.FutureCallback<org.opendaylight.yangtools.yang.common.Empty>, TopologyReference, org.opendaylight.mdsal.binding.api.DataTreeChangeListener<T>, 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.DataTreeChangeListener<T>, TopologyReference, com.google.common.util.concurrent.FutureCallback<org.opendaylight.yangtools.yang.common.Empty>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected @org.checkerframework.checker.lock.qual.GuardedBy({"this"}) int
     
    protected @org.checkerframework.checker.lock.qual.GuardedBy({"this"}) long
     
    protected boolean
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    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)
     
    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 Type
    Method
    Description
    protected abstract void
     
    final com.google.common.util.concurrent.FluentFuture<? extends org.opendaylight.mdsal.common.api.CommitInfo>
     
    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(List<org.opendaylight.mdsal.binding.api.DataTreeModification<T>> changes)
     
    final void
     
    final void
    onSuccess(org.opendaylight.yangtools.yang.common.Empty value)
     
    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
     

    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

      protected abstract org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> getRouteWildcard(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<Tables> tablesId)
    • createObject

      protected abstract void createObject(org.opendaylight.mdsal.binding.api.ReadWriteTransaction trans, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> id, T value)
    • removeObject

      protected abstract void removeObject(org.opendaylight.mdsal.binding.api.ReadWriteTransaction trans, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> id, T value)
    • 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 interface InstanceReference<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(List<org.opendaylight.mdsal.binding.api.DataTreeModification<T>> changes)
      Specified by:
      onDataTreeChanged in interface org.opendaylight.mdsal.binding.api.DataTreeChangeListener<T extends Route>
    • 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()
    • onFailure

      public final void onFailure(Throwable cause)
      Specified by:
      onFailure in interface com.google.common.util.concurrent.FutureCallback<T extends Route>
    • onSuccess

      public final void onSuccess(org.opendaylight.yangtools.yang.common.Empty value)
      Specified by:
      onSuccess in interface com.google.common.util.concurrent.FutureCallback<T extends Route>