public class DefaultTopology extends AbstractModel implements Topology
Constructor and Description |
---|
DefaultTopology(ProviderId providerId,
GraphDescription description)
Creates a topology descriptor attributed to the specified provider.
|
DefaultTopology(ProviderId providerId,
GraphDescription description,
com.google.common.base.Function<ConnectPoint,Boolean> broadcastFunction)
Creates a topology descriptor attributed to the specified provider.
|
Modifier and Type | Method and Description |
---|---|
Set<ConnectPoint> |
broadcastPoints(ClusterId clusterId)
Returns the set of the cluster broadcast points.
|
int |
broadcastSetSize(ClusterId clusterId)
Returns the size of the cluster broadcast set.
|
int |
clusterCount()
Returns the number of SCCs (strongly connected components) in the
topology.
|
long |
computeCost()
Returns the time, specified in system nanos of how long the topology took
to compute.
|
long |
creationTime()
Returns the time, specified in system millis of when the topology became
available.
|
int |
deviceCount()
Returns the number of infrastructure devices in the topology.
|
TopologyCluster |
getCluster(ClusterId clusterId)
Returns the specified topology cluster.
|
TopologyCluster |
getCluster(DeviceId deviceId)
Returns the topology cluster that contains the given device.
|
Set<DeviceId> |
getClusterDevices(TopologyCluster cluster)
Returns the set of cluster devices.
|
Set<Link> |
getClusterLinks(TopologyCluster cluster)
Returns the set of cluster links.
|
Set<TopologyCluster> |
getClusters()
Returns the set of topology clusters.
|
Set<DisjointPath> |
getDisjointPaths(DeviceId src,
DeviceId dst)
Returns the set of pre-computed shortest disjoint path pairs between
source and destination devices.
|
Set<DisjointPath> |
getDisjointPaths(DeviceId src,
DeviceId dst,
LinkWeigher weigher)
Computes on-demand the set of shortest disjoint path pairs between
source and destination devices.
|
Set<DisjointPath> |
getDisjointPaths(DeviceId src,
DeviceId dst,
LinkWeigher weigher,
Map<Link,Object> riskProfile)
Computes on-demand the set of shortest disjoint risk groups path pairs
between source and destination devices.
|
Set<DisjointPath> |
getDisjointPaths(DeviceId src,
DeviceId dst,
Map<Link,Object> riskProfile)
Computes on-demand the set of shortest disjoint risk groups path pairs
between source and destination devices.
|
TopologyGraph |
getGraph()
Returns the backing topology graph.
|
Stream<Path> |
getKShortestPaths(DeviceId src,
DeviceId dst)
Lazily computes on-demand the k-shortest paths between source and
destination devices.
|
Set<Path> |
getKShortestPaths(DeviceId src,
DeviceId dst,
int maxPaths)
Computes on-demand the k-shortest paths between source and
destination devices.
|
Stream<Path> |
getKShortestPaths(DeviceId src,
DeviceId dst,
LinkWeigher weigher)
Lazily computes on-demand the k-shortest paths between source and
destination devices.
|
Set<Path> |
getKShortestPaths(DeviceId src,
DeviceId dst,
LinkWeigher weigher,
int maxPaths)
Computes on-demand the k-shortest paths between source and
destination devices.
|
Set<Path> |
getPaths(DeviceId src,
DeviceId dst)
Returns the set of pre-computed shortest paths between source and
destination devices.
|
Set<Path> |
getPaths(DeviceId src,
DeviceId dst,
LinkWeigher weigher)
Computes on-demand the set of shortest paths between source and
destination devices.
|
Set<Path> |
getPaths(DeviceId src,
DeviceId dst,
LinkWeigher weigher,
int maxPaths)
Computes on-demand the set of shortest paths between source and
destination devices, the set of returned paths will be no more than,
maxPaths in size.
|
boolean |
isBroadcastPoint(ConnectPoint connectPoint)
Indicates whether the given point is part of a broadcast set.
|
boolean |
isInfrastructure(ConnectPoint connectPoint)
Indicates whether the given point is an infrastructure link end-point.
|
int |
linkCount()
Returns the number of infrastructure links in the topology.
|
static void |
setDefaultGraphPathSearch(GraphPathSearch<TopologyVertex,TopologyEdge> graphPathSearch)
Sets the default lpath search algorighm to be used when computing paths.
|
static void |
setDefaultLinkWeigher(LinkWeigher linkWeigher)
Sets the default link-weight to be used when computing paths.
|
long |
time()
Returns the time, specified in system nanos of when the topology became
available.
|
String |
toString() |
providerId
annotations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
providerId
public DefaultTopology(ProviderId providerId, GraphDescription description, com.google.common.base.Function<ConnectPoint,Boolean> broadcastFunction)
providerId
- identity of the providerdescription
- data describing the new topologybroadcastFunction
- broadcast point functionpublic DefaultTopology(ProviderId providerId, GraphDescription description)
providerId
- identity of the providerdescription
- data describing the new topologypublic static void setDefaultLinkWeigher(LinkWeigher linkWeigher)
linkWeigher
- new default link-weightpublic static void setDefaultGraphPathSearch(GraphPathSearch<TopologyVertex,TopologyEdge> graphPathSearch)
graphPathSearch
- new default algorithmpublic long time()
Topology
public long creationTime()
Topology
creationTime
in interface Topology
public long computeCost()
Topology
computeCost
in interface Topology
public int clusterCount()
Topology
clusterCount
in interface Topology
public int deviceCount()
Topology
deviceCount
in interface Topology
public int linkCount()
Topology
public TopologyGraph getGraph()
public Set<TopologyCluster> getClusters()
public TopologyCluster getCluster(ClusterId clusterId)
clusterId
- cluster identifierpublic TopologyCluster getCluster(DeviceId deviceId)
deviceId
- device identifierpublic Set<DeviceId> getClusterDevices(TopologyCluster cluster)
cluster
- topology clusterpublic Set<Link> getClusterLinks(TopologyCluster cluster)
cluster
- topology clusterpublic boolean isInfrastructure(ConnectPoint connectPoint)
connectPoint
- connection pointpublic boolean isBroadcastPoint(ConnectPoint connectPoint)
connectPoint
- connection pointpublic int broadcastSetSize(ClusterId clusterId)
clusterId
- cluster identifierpublic Set<ConnectPoint> broadcastPoints(ClusterId clusterId)
clusterId
- cluster identifierpublic Set<Path> getPaths(DeviceId src, DeviceId dst)
src
- source devicedst
- destination devicepublic Set<Path> getPaths(DeviceId src, DeviceId dst, LinkWeigher weigher)
src
- source devicedst
- destination deviceweigher
- link weight functionpublic Set<Path> getPaths(DeviceId src, DeviceId dst, LinkWeigher weigher, int maxPaths)
maxPaths
paths will be returned
maintaining any ordering guarantees provided by the underlying
(default or if no default is specified DijkstraGraphSearch
)
search. If returning all paths of a given length would exceed
maxPaths
a subset of paths of that length will be returned,
which paths will be returned depends on the currently specified
GraphPathSearch
. See setDefaultGraphPathSearch(org.onlab.graph.GraphPathSearch<org.onosproject.net.topology.TopologyVertex, org.onosproject.net.topology.TopologyEdge>)
.src
- source devicedst
- destination deviceweigher
- link weight functionmaxPaths
- maximum number of pathspublic Set<Path> getKShortestPaths(DeviceId src, DeviceId dst, int maxPaths)
src
- source devicedst
- destination devicemaxPaths
- maximum number of paths (k)public Set<Path> getKShortestPaths(DeviceId src, DeviceId dst, LinkWeigher weigher, int maxPaths)
maxPaths
paths will be returned
in ascending order according to the provided weigher
src
- source devicedst
- destination deviceweigher
- link weight functionmaxPaths
- maximum number of paths (k)public Stream<Path> getKShortestPaths(DeviceId src, DeviceId dst)
src
- source devicedst
- destination devicepublic Stream<Path> getKShortestPaths(DeviceId src, DeviceId dst, LinkWeigher weigher)
src
- source devicedst
- destination deviceweigher
- link weight functionpublic Set<DisjointPath> getDisjointPaths(DeviceId src, DeviceId dst)
src
- source devicedst
- destination devicepublic Set<DisjointPath> getDisjointPaths(DeviceId src, DeviceId dst, LinkWeigher weigher)
src
- source devicedst
- destination deviceweigher
- link weight functionpublic Set<DisjointPath> getDisjointPaths(DeviceId src, DeviceId dst, LinkWeigher weigher, Map<Link,Object> riskProfile)
src
- source devicedst
- destination deviceweigher
- edge weight objectriskProfile
- map representing risk groups for each linkpublic Set<DisjointPath> getDisjointPaths(DeviceId src, DeviceId dst, Map<Link,Object> riskProfile)
src
- source devicedst
- destination deviceriskProfile
- map representing risk groups for each link