Package org.apache.storm.flux.model
Class TopologyDef
java.lang.Object
org.apache.storm.flux.model.TopologyDef
Bean represenation of a topology.
It consists of the following:
1. The topology name
2. A `java.util.Map` representing the `org.apache.storm.config` for the topology
3. A list of spout definitions
4. A list of bolt definitions
5. A list of stream definitions that define the flow between spouts and bolts.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllBolts
(List<BoltDef> bolts, boolean override) Adds a list of bolt definitions.void
addAllComponents
(List<BeanDef> components, boolean override) Adds a list of component definitions.void
addAllSpouts
(List<SpoutDef> spouts, boolean override) Adds a list of spout definitions.void
addAllStreams
(List<StreamDef> streams, boolean override) Adds a list of stream definitions.void
addAllWorkerHooks
(List<WorkerHookDef> workerHooks, boolean override) Adds a list of worker hook definitions.getBoltDef
(String id) getBolts()
Returns bolt definitions.getComponent
(String id) Returns a list of all component definitions.getName()
getSpoutDef
(String id) Returns all spout definitions.getWorkerHook
(String id) Returns worker hook definitions.boolean
int
parallelismForBolt
(String boltId) void
Sets bolt definitions.void
setComponents
(List<BeanDef> components) Sets the list of component definitions.void
void
setIncludes
(List<IncludeDef> includes) void
void
Sets the name of the topology.void
Set spout definitions.void
setStreams
(List<StreamDef> streams) void
setTopologySource
(TopologySourceDef topologySource) void
setWorkerHooks
(List<WorkerHookDef> workerHooks) Sets worker hook definitions.boolean
validate()
Determines is this represents a valid Topology.
-
Constructor Details
-
TopologyDef
public TopologyDef()
-
-
Method Details
-
getName
-
setName
-
setName
Sets the name of the topology.- Parameters:
name
- topology nameoverride
- whether to override if already set
-
getSpouts
Returns all spout definitions.- Returns:
- spout definitions.
-
setSpouts
Set spout definitions.- Parameters:
spouts
- spout definitions
-
getBolts
Returns bolt definitions.- Returns:
- bolt definitions
-
setBolts
Sets bolt definitions.- Parameters:
bolts
- bolt definitions
-
getStreams
-
setStreams
-
getConfig
-
setConfig
-
getComponents
Returns a list of all component definitions.- Returns:
- components
-
setComponents
Sets the list of component definitions.- Parameters:
components
- components definitions
-
getIncludes
-
setIncludes
-
getWorkerHooks
Returns worker hook definitions.- Returns:
- worker hook definitions
-
setWorkerHooks
Sets worker hook definitions.- Parameters:
workerHooks
- worker hook definitions
-
parallelismForBolt
-
getBoltDef
-
getSpoutDef
-
getComponent
-
getWorkerHook
-
addAllBolts
Adds a list of bolt definitions. Optionally overriding existing definitions if one with the same ID already exists.- Parameters:
bolts
- bolt definitionsoverride
- whether or not to override existing definitions
-
addAllSpouts
Adds a list of spout definitions. Optionally overriding existing definitions if one with the same ID already exists.- Parameters:
spouts
- spout definitionsoverride
- whether or not to override existing definitions
-
addAllComponents
Adds a list of component definitions. Optionally overriding existing definitions if one with the same ID already exists.- Parameters:
components
- component definitionsoverride
- whether or not to override existing definitions
-
addAllStreams
Adds a list of stream definitions. Optionally overriding existing definitions if one with the same ID already exists.- Parameters:
streams
- stream definitionsoverride
- whether or not to override existing definitions (currently ignored)
-
addAllWorkerHooks
Adds a list of worker hook definitions. Optionally overriding existing definitions if one with the same ID already exists.- Parameters:
workerHooks
- worker hook definitionsoverride
- whether or not to override existing definitions
-
getTopologySource
-
setTopologySource
-
isDslTopology
public boolean isDslTopology() -
validate
public boolean validate()Determines is this represents a valid Topology.- Returns:
- true if valid
-