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 SummaryConstructors
- 
Method SummaryModifier 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- 
Builderpublic Builder()
 
- 
- 
Method Details- 
withSupervisorsSet the number of supervisors the cluster should have.
- 
withPortsPerSupervisorSet the number of slots/ports each supervisor should have.
- 
withDaemonConfSet the base config that the daemons should use.
- 
withDaemonConfAdd an single key/value config to the daemon conf.
- 
withINimbusOverride the INimbus instance that nimbus will use.
- 
withGroupMapperOverride the code that maps users to groups for authorization.
- 
withSupervisorSlotPortMinWhen assigning ports to worker slots start at minPort.
- 
withNimbusDaemonHave the local nimbus actually launch a thrift server. This is intended to be used mostly for internal storm testing.
- 
withNimbusDaemonIf nimbusDaemon is true the local nimbus will launch a thrift server. This is intended to be used mostly for internal storm testing.
- 
withSimulatedTimeTurn 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 theTimeclass for time management so it will not work in all cases.
- 
withSimulatedTimeTurn 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 theTimeclass for time management so it will not work in all cases.
- 
withNimbusWrapperBefore 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.
- 
withBlobStoreUse the following blobstore instead of the one in the config. This is intended mostly for internal testing with Mocks.
- 
withTopoCacheUse the following topo cache instead of creating out own. This is intended mostly for internal testing with Mocks.
- 
withClusterStateUse the following clusterState instead of the one in the config. This is intended mostly for internal testing with Mocks.
- 
withLeaderElectorUse the following leaderElector instead of the one in the config. This is intended mostly for internal testing with Mocks.
- 
withTrackedA tracked cluster can run tracked topologies. SeeTrackedTopologyfor more information on tracked topologies.- Parameters:
- trackId- an arbitrary unique id that is used to keep track of tracked topologies
 
- 
withTrackedA tracked cluster can run tracked topologies. SeeTrackedTopologyfor more information on tracked topologies.
- 
buildBuilds 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...
 
 
-