Jstorm/strom Configuring Executors and tasks (threads and instances)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.