Package org.apache.storm
Interface ILocalCluster
-
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
ILocalClusterTrackedTopologyAware
- All Known Implementing Classes:
LocalCluster
public interface ILocalCluster extends AutoCloseable
This is here mostly for backwards compatibility.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ILocalCluster.ILocalTopology
Close this class to kill the topology.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
activate(String topologyName)
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.ClusterSummary
getClusterInfo()
Get cluster information.IStormClusterState
getClusterState()
This is intended for internal testing only.StormTopology
getTopology(String id)
Get the compiled storm topology.String
getTopologyConf(String id)
The config of a topology as a JSON string.TopologyInfo
getTopologyInfo(String id)
Get the state of a topology.TopologyInfo
getTopologyInfoByName(String name)
Get the state of a topology.TopologyInfo
getTopologyInfoByNameWithOpts(String name, GetInfoOptions options)
Get the state of a topology.TopologyInfo
getTopologyInfoWithOpts(String id, GetInfoOptions options)
Get the state of a topology.List<TopologySummary>
getTopologySummaries()
TopologySummary
getTopologySummary(String id)
TopologySummary
getTopologySummaryByName(String name)
String
getTrackedId()
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.useAutoCloseable.close()
instead.ILocalCluster.ILocalTopology
submitTopology(String topologyName, Map<String,Object> conf, StormTopology topology)
Submit a topology to be run in local mode.ILocalCluster.ILocalTopology
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 Detail
-
submitTopology
ILocalCluster.ILocalTopology submitTopology(String topologyName, Map<String,Object> conf, StormTopology topology) throws org.apache.storm.thrift.TException
Submit 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.TException
Submit 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
void killTopology(String topologyName) throws org.apache.storm.thrift.TException
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
void activate(String topologyName) throws org.apache.storm.thrift.TException
Activate a topology.- Parameters:
topologyName
- the name of the topology to activate- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
deactivate
void deactivate(String topologyName) throws org.apache.storm.thrift.TException
Deactivate a topology.- Parameters:
topologyName
- the name of the topology to deactivate- Throws:
org.apache.storm.thrift.TException
- on any error from nimbus
-
rebalance
void rebalance(String name, RebalanceOptions options) throws org.apache.storm.thrift.TException
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 void shutdown()
Deprecated.useAutoCloseable.close()
instead.Shut down the cluster.
-
getTopologyConf
String getTopologyConf(String id) throws org.apache.storm.thrift.TException
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
StormTopology getTopology(String id) throws org.apache.storm.thrift.TException
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
ClusterSummary getClusterInfo() throws org.apache.storm.thrift.TException
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
List<TopologySummary> getTopologySummaries() throws org.apache.storm.thrift.TException
- Throws:
org.apache.storm.thrift.TException
-
getTopologySummaryByName
TopologySummary getTopologySummaryByName(String name) throws org.apache.storm.thrift.TException
- Throws:
org.apache.storm.thrift.TException
-
getTopologySummary
TopologySummary getTopologySummary(String id) throws org.apache.storm.thrift.TException
- Throws:
org.apache.storm.thrift.TException
-
getTopologyInfo
TopologyInfo getTopologyInfo(String id) throws org.apache.storm.thrift.TException
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
TopologyInfo getTopologyInfoByName(String name) throws org.apache.storm.thrift.TException
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
void advanceClusterTime(int secs) throws InterruptedException
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
void advanceClusterTime(int secs, int steps) throws InterruptedException
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
-
-