Note: The jstorm is immediately fused to the Strom kernel, which means there is no Strom in the future. But Twitter has preached about their heron system,
Jstorm Author's blog Analysis: in- depth analysis of Twitter Heron[http://www.longda.us/?p=529] Twitter Heron[http// WWW.LONGDA.US/?P=529]
Configuring Executors and tasks (threads and instances)
Please always remember the title: Executors and tasks (threads and instances),executors represent thread concepts,tasks represent spout or bolt instances.
Storm creates a task (task) by default for each composition (Spout/bolt), and a default task run is called by a thread (executor).
> setspout (String ID, irichspout spout,number parallelism_hint)
The above configuration indicates that the topology is to create parallelism_hint tasks, and each task is called by its own thread (executor). The number of tasks is the same as the number of threads.
> setspout (String ID, irichspout spout,number parallelism_hint). Setnumtasks (number Val)
The above configuration represents the topology configuration for the Val task, which is assigned to Parallelism_hint threads on an average. (Val/parallelism_hint average distribution).
Note: The configuration item in Jstorm:
> @Deprecated
T setnumtasks (number val)
The method in the above Jstorm has been set for the configuration is obsolete.
>/**
* Define a new spout in this topology with the specified parallelism. If
* The spout declares itself as non-distributed, the Parallelism_hint would
* be ignored and only one task would be allocated to this component.
*
* @param ID
* The ID of this component. This ID was referenced by other
* Components of that want to consume this spout ' s outputs.
* @param parallelism_hint
* The number of the tasks that should is assigned to execute this
* Spout. Each task would run on a thread in a process Somwehere
* Around the cluster.
* @param spout
* The spout
*/
Public Spoutdeclarer setspout (String ID, irichspout spout,
Number Parallelism_hint)
Jstorm sets the parallel parallelism_hint that represents the number of instances and also the number of threads. The same number.
Copyright NOTICE: This article for Bo Master original article, without BO Master permission cannot reprint [http://blog.csdn.net/doctor_who2004].
Jstorm/strom Configuring Executors and tasks (threads and instances)