public class TopologyDef extends Object
Bean represenation of a topology.
It consists of the following: 1. The topology name 2. Ajava.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 and Description |
---|
TopologyDef() |
Modifier and Type | Method and Description |
---|---|
void |
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.
|
BoltDef |
getBoltDef(String id) |
List<BoltDef> |
getBolts()
Returns bolt definitions.
|
BeanDef |
getComponent(String id) |
List<BeanDef> |
getComponents()
Returns a list of all component definitions.
|
Map<String,Object> |
getConfig() |
List<IncludeDef> |
getIncludes() |
String |
getName() |
SpoutDef |
getSpoutDef(String id) |
List<SpoutDef> |
getSpouts()
Returns all spout definitions.
|
List<StreamDef> |
getStreams() |
TopologySourceDef |
getTopologySource() |
boolean |
isDslTopology() |
int |
parallelismForBolt(String boltId) |
void |
setBolts(List<BoltDef> bolts)
Sets bolt definitions.
|
void |
setComponents(List<BeanDef> components)
Sets the list of component definitions.
|
void |
setConfig(Map<String,Object> config) |
void |
setIncludes(List<IncludeDef> includes) |
void |
setName(String name) |
void |
setName(String name,
boolean override)
Sets the name of the topology.
|
void |
setSpouts(List<SpoutDef> spouts)
Set spout definitions.
|
void |
setStreams(List<StreamDef> streams) |
void |
setTopologySource(TopologySourceDef topologySource) |
boolean |
validate()
Determines is this represents a valid Topology.
|
public String getName()
public void setName(String name)
public void setName(String name, boolean override)
Sets the name of the topology.
name
- topology nameoverride
- whether to override if already setpublic List<SpoutDef> getSpouts()
Returns all spout definitions.
public void setSpouts(List<SpoutDef> spouts)
Set spout definitions.
spouts
- spout definitionspublic void setBolts(List<BoltDef> bolts)
Sets bolt definitions.
bolts
- bolt definitionspublic List<BeanDef> getComponents()
Returns a list of all component definitions.
public void setComponents(List<BeanDef> components)
Sets the list of component definitions.
components
- components definitionspublic List<IncludeDef> getIncludes()
public void setIncludes(List<IncludeDef> includes)
public int parallelismForBolt(String boltId)
public void addAllBolts(List<BoltDef> bolts, boolean override)
Adds a list of bolt definitions. Optionally overriding existing definitions if one with the same ID already exists.
bolts
- bolt definitionsoverride
- whether or not to override existing definitionspublic void addAllSpouts(List<SpoutDef> spouts, boolean override)
Adds a list of spout definitions. Optionally overriding existing definitions if one with the same ID already exists.
spouts
- spout definitionsoverride
- whether or not to override existing definitionspublic void addAllComponents(List<BeanDef> components, boolean override)
Adds a list of component definitions. Optionally overriding existing definitions if one with the same ID already exists.
components
- component definitionsoverride
- whether or not to override existing definitionspublic void addAllStreams(List<StreamDef> streams, boolean override)
Adds a list of stream definitions. Optionally overriding existing definitions if one with the same ID already exists.
streams
- stream definitionsoverride
- whether or not to override existing definitions (currently ignored)public TopologySourceDef getTopologySource()
public void setTopologySource(TopologySourceDef topologySource)
public boolean isDslTopology()
public boolean validate()
Determines is this represents a valid Topology.
Copyright © 2022 The Apache Software Foundation. All rights reserved.