Package org.apache.heron.simulator
Class Simulator
- java.lang.Object
-
- org.apache.heron.simulator.Simulator
-
public class Simulator extends Object
One Simulator instance can only submit one topology. Please have multiple Simulator instances for multiple topologies.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Simulator.DefaultExceptionHandler
Handler for catching exceptions thrown by any threads (owned either by topology or heron infrastructure).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(String topologyName)
void
deactivate(String topologyName)
protected org.apache.heron.common.config.SystemConfig
getSystemConfig()
protected void
init()
protected boolean
isSystemConfigExisted()
Check if the system config is already registered into the SingleRegistryvoid
killTopology(String topologyName)
protected void
registerSystemConfig(org.apache.heron.common.config.SystemConfig sysConfig)
Register the given system configvoid
shutdown()
void
stop()
void
submitTopology(String name, org.apache.heron.api.Config heronConfig, org.apache.heron.api.HeronTopology heronTopology)
Submit and run topology in simulator
-
-
-
Method Detail
-
init
protected void init()
-
isSystemConfigExisted
protected boolean isSystemConfigExisted()
Check if the system config is already registered into the SingleRegistry- Returns:
- true if it's registered; false otherwise
-
registerSystemConfig
protected void registerSystemConfig(org.apache.heron.common.config.SystemConfig sysConfig)
Register the given system config
-
submitTopology
public void submitTopology(String name, org.apache.heron.api.Config heronConfig, org.apache.heron.api.HeronTopology heronTopology)
Submit and run topology in simulator- Parameters:
name
- topology nameheronConfig
- topology configheronTopology
- topology built from topology builder
-
killTopology
public void killTopology(String topologyName)
-
activate
public void activate(String topologyName)
-
deactivate
public void deactivate(String topologyName)
-
shutdown
public void shutdown()
-
stop
public void stop()
-
getSystemConfig
protected org.apache.heron.common.config.SystemConfig getSystemConfig()
-
-