Package org.apache.storm
Class LocalCluster.Builder
java.lang.Object
org.apache.storm.LocalCluster.Builder
- Enclosing class:
- LocalCluster
Simple way to configure a LocalCluster to meet your needs.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a new LocalCluster.withBlobStore
(BlobStore store) Use the following blobstore instead of the one in the config.withClusterState
(IStormClusterState clusterState) Use the following clusterState instead of the one in the config.withDaemonConf
(String key, Object value) Add an single key/value config to the daemon conf.withDaemonConf
(Map<String, Object> conf) Set the base config that the daemons should use.withGroupMapper
(IGroupMappingServiceProvider groupMapper) Override the code that maps users to groups for authorization.withINimbus
(INimbus inimbus) Override the INimbus instance that nimbus will use.withLeaderElector
(ILeaderElector leaderElector) Use the following leaderElector instead of the one in the config.Have the local nimbus actually launch a thrift server.withNimbusDaemon
(Boolean nimbusDaemon) If nimbusDaemon is true the local nimbus will launch a thrift server.withNimbusWrapper
(UnaryOperator<Nimbus> nimbusWrapper) Before nimbus is created/used call nimbusWrapper on it first and use the result instead.withPortsPerSupervisor
(int portsPerSupervisor) Set the number of slots/ports each supervisor should have.Turn on simulated time in the cluster.withSimulatedTime
(boolean simulateTime) Turn on simulated time in the cluster.withSupervisors
(int supervisors) Set the number of supervisors the cluster should have.withSupervisorSlotPortMin
(Number minPort) When assigning ports to worker slots start at minPort.withTopoCache
(TopoCache topoCache) Use the following topo cache instead of creating out own.A tracked cluster can run tracked topologies.withTracked
(String trackId) A tracked cluster can run tracked topologies.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withSupervisors
Set the number of supervisors the cluster should have. -
withPortsPerSupervisor
Set the number of slots/ports each supervisor should have. -
withDaemonConf
Set the base config that the daemons should use. -
withDaemonConf
Add an single key/value config to the daemon conf. -
withINimbus
Override the INimbus instance that nimbus will use. -
withGroupMapper
Override the code that maps users to groups for authorization. -
withSupervisorSlotPortMin
When assigning ports to worker slots start at minPort. -
withNimbusDaemon
Have the local nimbus actually launch a thrift server. This is intended to be used mostly for internal storm testing. -
withNimbusDaemon
If nimbusDaemon is true the local nimbus will launch a thrift server. This is intended to be used mostly for internal storm testing. -
withSimulatedTime
Turn on simulated time in the cluster. This allows someone to simulate long periods of time for timeouts etc when testing nimbus/supervisors themselves. NOTE: that this only works for code that uses theTime
class for time management so it will not work in all cases. -
withSimulatedTime
Turn on simulated time in the cluster. This allows someone to simulate long periods of time for timeouts etc when testing nimbus/supervisors themselves. NOTE: that this only works for code that uses theTime
class for time management so it will not work in all cases. -
withNimbusWrapper
Before nimbus is created/used call nimbusWrapper on it first and use the result instead. This is intended for internal testing only, and it here to allow a mocking framework to spy on the nimbus class. -
withBlobStore
Use the following blobstore instead of the one in the config. This is intended mostly for internal testing with Mocks. -
withTopoCache
Use the following topo cache instead of creating out own. This is intended mostly for internal testing with Mocks. -
withClusterState
Use the following clusterState instead of the one in the config. This is intended mostly for internal testing with Mocks. -
withLeaderElector
Use the following leaderElector instead of the one in the config. This is intended mostly for internal testing with Mocks. -
withTracked
A tracked cluster can run tracked topologies. SeeTrackedTopology
for more information on tracked topologies.- Parameters:
trackId
- an arbitrary unique id that is used to keep track of tracked topologies
-
withTracked
A tracked cluster can run tracked topologies. SeeTrackedTopology
for more information on tracked topologies. -
build
Builds a new LocalCluster.- Returns:
- the LocalCluster
- Throws:
Exception
- on any one of many different errors. This is intended for testing so yes it is ugly and throws Exception...
-