Package org.apache.storm
Interface ILocalCluster
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
ILocalClusterTrackedTopologyAware
- All Known Implementing Classes:
LocalCluster
This is here mostly for backwards compatibility.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Close this class to kill the topology. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Activate a topology.void
advanceClusterTime
(int secs) Advance the cluster time when the cluster is using SimulatedTime.void
advanceClusterTime
(int secs, int steps) Advance the cluster time when the cluster is using SimulatedTime.void
deactivate
(String topologyName) Deactivate a topology.Get cluster information.This is intended for internal testing only.getTopology
(String id) Get the compiled storm topology.The config of a topology as a JSON string.Get the state of a topology.getTopologyInfoByName
(String name) Get the state of a topology.getTopologyInfoByNameWithOpts
(String name, GetInfoOptions options) Get the state of a topology.getTopologyInfoWithOpts
(String id, GetInfoOptions options) Get the state of a topology.If the cluster is tracked get the id for the tracked cluster.void
killTopology
(String topologyName) Kill a topology (if you are not using ILocalTopology).void
killTopologyWithOpts
(String topologyName, KillOptions options) Kill a topology (if you are not using ILocalTopology).void
rebalance
(String name, RebalanceOptions options) Rebalance a topology.void
shutdown()
Deprecated.submitTopology
(String topologyName, Map<String, Object> conf, StormTopology topology) Submit a topology to be run in local mode.submitTopologyWithOpts
(String topologyName, Map<String, Object> conf, StormTopology topology, SubmitOptions submitOpts) Submit a topology to be run in local mode.void
uploadNewCredentials
(String topologyName, Credentials creds) Upload new credentials to a topology.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
submitTopology
ILocalCluster.ILocalTopology submitTopology(String topologyName, Map<String, Object> conf, StormTopology topology) throws org.apache.storm.thrift.TExceptionSubmit a topology to be run in local mode.- Parameters:
topologyName
- the name of the topology to useconf
- the config for the topologytopology
- the topology itself.- Returns:
- an AutoCloseable that will kill the topology.
- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
submitTopologyWithOpts
ILocalCluster.ILocalTopology submitTopologyWithOpts(String topologyName, Map<String, Object> conf, StormTopology topology, SubmitOptions submitOpts) throws org.apache.storm.thrift.TExceptionSubmit a topology to be run in local mode.- Parameters:
topologyName
- the name of the topology to useconf
- the config for the topologytopology
- the topology itself.submitOpts
- options for topology- Returns:
- an AutoCloseable that will kill the topology.
- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
uploadNewCredentials
void uploadNewCredentials(String topologyName, Credentials creds) throws org.apache.storm.thrift.TException Upload new credentials to a topology.- Parameters:
topologyName
- the name of the topologycreds
- the new credentails for the topology.- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
killTopology
Kill a topology (if you are not using ILocalTopology).- Parameters:
topologyName
- the name of the topology- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
killTopologyWithOpts
void killTopologyWithOpts(String topologyName, KillOptions options) throws org.apache.storm.thrift.TException Kill a topology (if you are not using ILocalTopology).- Parameters:
topologyName
- the name of the topologyoptions
- for how to kill the topology- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
activate
Activate a topology.- Parameters:
topologyName
- the name of the topology to activate- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
deactivate
Deactivate a topology.- Parameters:
topologyName
- the name of the topology to deactivate- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
rebalance
Rebalance a topology.- Parameters:
name
- the name of the topologyoptions
- options for rebalanceing the topology.- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
shutdown
Deprecated.useAutoCloseable.close()
instead.Shut down the cluster. -
getTopologyConf
The config of a topology as a JSON string.- Parameters:
id
- the id of the topology (not the name)- Returns:
- The config of a topology as a JSON string
- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
getTopology
Get the compiled storm topology.- Parameters:
id
- the id of the topology (not the name)- Returns:
- the compiled storm topology
- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
getClusterInfo
Get cluster information.- Returns:
- a summary of the current state of the cluster
- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
getTopologySummaries
- Throws:
org.apache.storm.thrift.TException
-
getTopologySummaryByName
- Throws:
org.apache.storm.thrift.TException
-
getTopologySummary
- Throws:
org.apache.storm.thrift.TException
-
getTopologyInfo
Get the state of a topology.- Parameters:
id
- the id of the topology (not the name)- Returns:
- the state of a topology
- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
getTopologyInfoByName
Get the state of a topology.- Parameters:
name
- the name of the topology (not the id)- Returns:
- the state of a topology
- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
getTopologyInfoWithOpts
TopologyInfo getTopologyInfoWithOpts(String id, GetInfoOptions options) throws org.apache.storm.thrift.TException Get the state of a topology.- Parameters:
id
- the id of the topology (not the name)options
- This is to choose number of Error(s) in TopologyInfo.- Returns:
- the state of a topology
- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
getTopologyInfoByNameWithOpts
TopologyInfo getTopologyInfoByNameWithOpts(String name, GetInfoOptions options) throws org.apache.storm.thrift.TException Get the state of a topology.- Parameters:
name
- the name of the topology (not the id)options
- This is GetInfoOptions to choose Error(s) in on TopologyInfo.- Returns:
- the state of a topology
- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
getClusterState
IStormClusterState getClusterState()This is intended for internal testing only.- Returns:
- an internal class that holds the state of the cluster.
-
advanceClusterTime
Advance the cluster time when the cluster is using SimulatedTime. This is intended for internal testing only.- Parameters:
secs
- the number of seconds to advance time- Throws:
InterruptedException
-
advanceClusterTime
Advance the cluster time when the cluster is using SimulatedTime. This is intended for internal testing only.- Parameters:
secs
- the number of seconds to advance timesteps
- the number of steps we should take when advancing simulated time- Throws:
InterruptedException
-
getTrackedId
String getTrackedId()If the cluster is tracked get the id for the tracked cluster. This is intended for internal testing only.- Returns:
- the id of the tracked cluster
-
AutoCloseable.close()
instead.