Class DefaultTopology

    • Constructor Detail

      • DefaultTopology

        public DefaultTopology​(ProviderId providerId,
                               GraphDescription description,
                               com.google.common.base.Function<ConnectPoint,​java.lang.Boolean> broadcastFunction)
        Creates a topology descriptor attributed to the specified provider.
        Parameters:
        providerId - identity of the provider
        description - data describing the new topology
        broadcastFunction - broadcast point function
      • DefaultTopology

        public DefaultTopology​(ProviderId providerId,
                               GraphDescription description)
        Creates a topology descriptor attributed to the specified provider.
        Parameters:
        providerId - identity of the provider
        description - data describing the new topology
    • Method Detail

      • setDefaultLinkWeigher

        public static void setDefaultLinkWeigher​(LinkWeigher linkWeigher)
        Sets the default link-weight to be used when computing paths. If null is specified, the builtin default link-weight measuring hop-counts will be used.
        Parameters:
        linkWeigher - new default link-weight
      • setDefaultGraphPathSearch

        public static void setDefaultGraphPathSearch​(GraphPathSearch<TopologyVertex,​TopologyEdge> graphPathSearch)
        Sets the default lpath search algorighm to be used when computing paths. If null is specified, the builtin default Dijkstra will be used.
        Parameters:
        graphPathSearch - new default algorithm
      • time

        public long time()
        Description copied from interface: Topology
        Returns the time, specified in system nanos of when the topology became available.
        Specified by:
        time in interface Topology
        Returns:
        time in system nanos
      • creationTime

        public long creationTime()
        Description copied from interface: Topology
        Returns the time, specified in system millis of when the topology became available.
        Specified by:
        creationTime in interface Topology
        Returns:
        time in system nanos
      • computeCost

        public long computeCost()
        Description copied from interface: Topology
        Returns the time, specified in system nanos of how long the topology took to compute.
        Specified by:
        computeCost in interface Topology
        Returns:
        elapsed time in system nanos
      • clusterCount

        public int clusterCount()
        Description copied from interface: Topology
        Returns the number of SCCs (strongly connected components) in the topology.
        Specified by:
        clusterCount in interface Topology
        Returns:
        number of clusters
      • deviceCount

        public int deviceCount()
        Description copied from interface: Topology
        Returns the number of infrastructure devices in the topology.
        Specified by:
        deviceCount in interface Topology
        Returns:
        number of devices
      • linkCount

        public int linkCount()
        Description copied from interface: Topology
        Returns the number of infrastructure links in the topology.
        Specified by:
        linkCount in interface Topology
        Returns:
        number of links
      • getGraph

        public TopologyGraph getGraph()
        Returns the backing topology graph.
        Returns:
        topology graph
      • getClusters

        public java.util.Set<TopologyCluster> getClusters()
        Returns the set of topology clusters.
        Returns:
        set of clusters
      • getCluster

        public TopologyCluster getCluster​(ClusterId clusterId)
        Returns the specified topology cluster.
        Parameters:
        clusterId - cluster identifier
        Returns:
        topology cluster
      • getCluster

        public TopologyCluster getCluster​(DeviceId deviceId)
        Returns the topology cluster that contains the given device.
        Parameters:
        deviceId - device identifier
        Returns:
        topology cluster
      • getClusterDevices

        public java.util.Set<DeviceId> getClusterDevices​(TopologyCluster cluster)
        Returns the set of cluster devices.
        Parameters:
        cluster - topology cluster
        Returns:
        cluster devices
      • getClusterLinks

        public java.util.Set<Link> getClusterLinks​(TopologyCluster cluster)
        Returns the set of cluster links.
        Parameters:
        cluster - topology cluster
        Returns:
        cluster links
      • isInfrastructure

        public boolean isInfrastructure​(ConnectPoint connectPoint)
        Indicates whether the given point is an infrastructure link end-point.
        Parameters:
        connectPoint - connection point
        Returns:
        true if infrastructure
      • isBroadcastPoint

        public boolean isBroadcastPoint​(ConnectPoint connectPoint)
        Indicates whether the given point is part of a broadcast set.
        Parameters:
        connectPoint - connection point
        Returns:
        true if in broadcast set
      • broadcastSetSize

        public int broadcastSetSize​(ClusterId clusterId)
        Returns the size of the cluster broadcast set.
        Parameters:
        clusterId - cluster identifier
        Returns:
        size of the cluster broadcast set
      • broadcastPoints

        public java.util.Set<ConnectPoint> broadcastPoints​(ClusterId clusterId)
        Returns the set of the cluster broadcast points.
        Parameters:
        clusterId - cluster identifier
        Returns:
        set of cluster broadcast points
      • getPaths

        public java.util.Set<Path> getPaths​(DeviceId src,
                                            DeviceId dst)
        Returns the set of pre-computed shortest paths between source and destination devices.
        Parameters:
        src - source device
        dst - destination device
        Returns:
        set of shortest paths
      • getPaths

        public java.util.Set<Path> getPaths​(DeviceId src,
                                            DeviceId dst,
                                            LinkWeigher weigher)
        Computes on-demand the set of shortest paths between source and destination devices.
        Parameters:
        src - source device
        dst - destination device
        weigher - link weight function
        Returns:
        set of shortest paths
      • getKShortestPaths

        public java.util.Set<Path> getKShortestPaths​(DeviceId src,
                                                     DeviceId dst,
                                                     int maxPaths)
        Computes on-demand the k-shortest paths between source and destination devices.
        Parameters:
        src - source device
        dst - destination device
        maxPaths - maximum number of paths (k)
        Returns:
        set of k-shortest paths
      • getKShortestPaths

        public java.util.Set<Path> getKShortestPaths​(DeviceId src,
                                                     DeviceId dst,
                                                     LinkWeigher weigher,
                                                     int maxPaths)
        Computes on-demand the k-shortest paths between source and destination devices. The first maxPaths paths will be returned in ascending order according to the provided weigher
        Parameters:
        src - source device
        dst - destination device
        weigher - link weight function
        maxPaths - maximum number of paths (k)
        Returns:
        set of k-shortest paths
      • getKShortestPaths

        public java.util.stream.Stream<Path> getKShortestPaths​(DeviceId src,
                                                               DeviceId dst)
        Lazily computes on-demand the k-shortest paths between source and destination devices.
        Parameters:
        src - source device
        dst - destination device
        Returns:
        stream of k-shortest paths
      • getKShortestPaths

        public java.util.stream.Stream<Path> getKShortestPaths​(DeviceId src,
                                                               DeviceId dst,
                                                               LinkWeigher weigher)
        Lazily computes on-demand the k-shortest paths between source and destination devices.
        Parameters:
        src - source device
        dst - destination device
        weigher - link weight function
        Returns:
        stream of k-shortest paths
      • getDisjointPaths

        public java.util.Set<DisjointPath> getDisjointPaths​(DeviceId src,
                                                            DeviceId dst)
        Returns the set of pre-computed shortest disjoint path pairs between source and destination devices.
        Parameters:
        src - source device
        dst - destination device
        Returns:
        set of shortest disjoint path pairs
      • getDisjointPaths

        public java.util.Set<DisjointPath> getDisjointPaths​(DeviceId src,
                                                            DeviceId dst,
                                                            LinkWeigher weigher)
        Computes on-demand the set of shortest disjoint path pairs between source and destination devices.
        Parameters:
        src - source device
        dst - destination device
        weigher - link weight function
        Returns:
        set of disjoint shortest path pairs
      • getDisjointPaths

        public java.util.Set<DisjointPath> getDisjointPaths​(DeviceId src,
                                                            DeviceId dst,
                                                            LinkWeigher weigher,
                                                            java.util.Map<Link,​java.lang.Object> riskProfile)
        Computes on-demand the set of shortest disjoint risk groups path pairs between source and destination devices.
        Parameters:
        src - source device
        dst - destination device
        weigher - edge weight object
        riskProfile - map representing risk groups for each link
        Returns:
        set of shortest disjoint paths
      • getDisjointPaths

        public java.util.Set<DisjointPath> getDisjointPaths​(DeviceId src,
                                                            DeviceId dst,
                                                            java.util.Map<Link,​java.lang.Object> riskProfile)
        Computes on-demand the set of shortest disjoint risk groups path pairs between source and destination devices.
        Parameters:
        src - source device
        dst - destination device
        riskProfile - map representing risk groups for each link
        Returns:
        set of shortest disjoint paths
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object