Package org.apache.storm.scheduler
Class Topologies
- java.lang.Object
-
- org.apache.storm.scheduler.Topologies
-
- All Implemented Interfaces:
Iterable<TopologyDetails>
public class Topologies extends Object implements Iterable<TopologyDetails>
-
-
Constructor Summary
Constructors Constructor Description Topologies(Map<String,TopologyDetails> topologies)
Create a new Topologies from a map of id to topology.Topologies(Topologies src)
Copy constructor.Topologies(TopologyDetails... details)
Create a new Topologies from a list of TopologyDetails.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<String>
getAllIds()
TopologyDetails
getById(String topologyId)
Get a topology given an ID.TopologyDetails
getByName(String topologyName)
Get a topology given a topology name.Collection<TopologyDetails>
getTopologies()
Collection<TopologyDetails>
getTopologiesOwnedBy(String user)
Get all topologies submitted/owned by a given user.Iterator<TopologyDetails>
iterator()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
Topologies
public Topologies(TopologyDetails... details)
Create a new Topologies from a list of TopologyDetails.- Parameters:
details
- the list of details to use.- Throws:
IllegalArgumentException
- if duplicate topology ids are found.
-
Topologies
public Topologies(Map<String,TopologyDetails> topologies)
Create a new Topologies from a map of id to topology.- Parameters:
topologies
- a map of topology id to topology details
-
Topologies
public Topologies(Topologies src)
Copy constructor.
-
-
Method Detail
-
getAllIds
public Collection<String> getAllIds()
-
getById
public TopologyDetails getById(String topologyId)
Get a topology given an ID.- Parameters:
topologyId
- the id of the topology to get- Returns:
- the topology or null if it is not found
-
getByName
public TopologyDetails getByName(String topologyName)
Get a topology given a topology name. Nimbus prevents multiple topologies from having the same name, so this assumes it is true.- Parameters:
topologyName
- the name of the topology to look for- Returns:
- the a topology with the given name.
-
getTopologies
public Collection<TopologyDetails> getTopologies()
-
getTopologiesOwnedBy
public Collection<TopologyDetails> getTopologiesOwnedBy(String user)
Get all topologies submitted/owned by a given user.- Parameters:
user
- the name of the user- Returns:
- all of the topologies submitted by this user.
-
iterator
public Iterator<TopologyDetails> iterator()
- Specified by:
iterator
in interfaceIterable<TopologyDetails>
-
-