public interface IStateManager
extends java.lang.AutoCloseable
Services across Heron use HeronStateMgr to get/set state information. Currently the primary things kept by state are: 1. Where is the the topology master running. The topology master is responsible for writing this information out upon startup. The stream managers query this upon startup to find out who is their topology master. In case they loose connection with the topology master, the stream managers query this again to see if the topology master has changed.
2. Topology and the current running state of the topology This information is seeded by the topology submitter. The topology master updates this when the state of the topology changes.
3. Current assignment. This information is solely used by topology master. When it creates a new assignment or when the assignment changes, it writes out this information. This is required for topology master failover.
Clients call the methods of the state passing a callback. The callback is called with result code upon the completion of the operation.
Modifier and Type | Method and Description |
---|---|
void |
close()
This is to for disposing or cleaning up any internal state accumulated by
the StateManager
|
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
deleteExecutionState(java.lang.String topologyName)
Delete the execution state for the given topology
|
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
deletePhysicalPlan(java.lang.String topologyName)
Delete the physical plan for the given topology
|
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
deleteSchedulerLocation(java.lang.String topologyName)
Delete the scheduler location for the given topology
|
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
deleteTMasterLocation(java.lang.String topologyName)
Delete the tmaster location for the given topology
|
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
deleteTopology(java.lang.String topologyName)
Delete the topology definition for the given topology
|
com.google.common.util.concurrent.ListenableFuture<ExecutionEnvironment.ExecutionState> |
getExecutionState(WatchCallback watcher,
java.lang.String topologyName)
Get the execution state for the given topology
|
com.google.common.util.concurrent.ListenableFuture<PhysicalPlans.PhysicalPlan> |
getPhysicalPlan(WatchCallback watcher,
java.lang.String topologyName)
Get the physical plan for the given topology
|
com.google.common.util.concurrent.ListenableFuture<Scheduler.SchedulerLocation> |
getSchedulerLocation(WatchCallback watcher,
java.lang.String topologyName)
Get the scheduler location for the given topology
|
com.google.common.util.concurrent.ListenableFuture<TopologyMaster.TMasterLocation> |
getTMasterLocation(WatchCallback watcher,
java.lang.String topologyName)
Get the tmaster location for the given topology
|
com.google.common.util.concurrent.ListenableFuture<TopologyAPI.Topology> |
getTopology(WatchCallback watcher,
java.lang.String topologyName)
Get the topology definition for the given topology
|
void |
initialize(Config config)
Initialize StateManager with the incoming context.
|
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
isTopologyRunning(java.lang.String topologyName)
Is the given topology in RUNNING state?
|
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
setExecutionState(ExecutionEnvironment.ExecutionState executionState,
java.lang.String topologyName)
Set the execution state for the given topology
|
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
setPhysicalPlan(PhysicalPlans.PhysicalPlan physicalPlan,
java.lang.String topologyName)
Set the physical plan for the given topology
|
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
setSchedulerLocation(Scheduler.SchedulerLocation location,
java.lang.String topologyName)
Set the scheduler location for the given topology
|
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
setTMasterLocation(TopologyMaster.TMasterLocation location,
java.lang.String topologyName)
Set the location of Tmaster.
|
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
setTopology(TopologyAPI.Topology topology,
java.lang.String topologyName)
Set the topology definition for the given topology
|
void initialize(Config config)
void close()
Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.
close
in interface java.lang.AutoCloseable
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> isTopologyRunning(java.lang.String topologyName)
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> setExecutionState(ExecutionEnvironment.ExecutionState executionState, java.lang.String topologyName)
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> setTopology(TopologyAPI.Topology topology, java.lang.String topologyName)
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> setSchedulerLocation(Scheduler.SchedulerLocation location, java.lang.String topologyName)
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> deleteTMasterLocation(java.lang.String topologyName)
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> deleteExecutionState(java.lang.String topologyName)
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> deleteTopology(java.lang.String topologyName)
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> deletePhysicalPlan(java.lang.String topologyName)
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> deleteSchedulerLocation(java.lang.String topologyName)
com.google.common.util.concurrent.ListenableFuture<TopologyMaster.TMasterLocation> getTMasterLocation(WatchCallback watcher, java.lang.String topologyName)
watcher
- @see com.twitter.heron.spi.statemgr.WatchCallbackcom.google.common.util.concurrent.ListenableFuture<Scheduler.SchedulerLocation> getSchedulerLocation(WatchCallback watcher, java.lang.String topologyName)
watcher
- @see com.twitter.heron.spi.statemgr.WatchCallbackcom.google.common.util.concurrent.ListenableFuture<TopologyAPI.Topology> getTopology(WatchCallback watcher, java.lang.String topologyName)
watcher
- @see com.twitter.heron.spi.statemgr.WatchCallbackcom.google.common.util.concurrent.ListenableFuture<ExecutionEnvironment.ExecutionState> getExecutionState(WatchCallback watcher, java.lang.String topologyName)
watcher
- @see com.twitter.heron.spi.statemgr.WatchCallbackcom.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> setTMasterLocation(TopologyMaster.TMasterLocation location, java.lang.String topologyName)
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> setPhysicalPlan(PhysicalPlans.PhysicalPlan physicalPlan, java.lang.String topologyName)
com.google.common.util.concurrent.ListenableFuture<PhysicalPlans.PhysicalPlan> getPhysicalPlan(WatchCallback watcher, java.lang.String topologyName)
watcher
- @see com.twitter.heron.spi.statemgr.WatchCallback