Storm Configuration Graphic Parsing
Reference reading: http://www.xiaofateng.com/?p=959
============================== | Sample-topology | | ------------------------ | Task 1 Task 2 Task 3 | | Worker Process 1 | | T1 T2 T3 | | +--------+ | | Spout = Bolt and Bolt | | +------+ | +----+ | | | Parallelism parallelism Parallelism | | | T3 | | | T2 | | | | hint=2 hint=2 hint=6 | | +------+ | +----+ | | | | | | +----+ | | | Combined parallelism = 2 + 2 + 6 = 10 | | +------+ | | T2 | | | | | | | T3 | | +----+ | | | Each of the 2 worker processes'll spawn 10/2=5 threads | | +------+ +--------+ | | | | | | T1:parallelism hint = initial executors | | +------+ +--------+ | | | | | T3 | | T1 | | | T2:the T2 Bolt is configured to use 2 executors and four tasks. | | +------+ +--------+ | | ForThis reason each executor runs the tasks for this bolt. | ------------------------ | | | | ------------------------ | Config conf = new config (); | | Worker Process 2 | | | | +--------+ | | Run as 2 workers on 2 supervisors | | +------+ | +----+ | | | Conf.setnumworkers (2); | | | T3 | | | T2 | | | | | | +------+ | +----+ | | | T1:2 Executors for spout | | | +----+ | | | Topologybuilder.setspout ("T1-spout", New T1spout (), 2); | | +------+ | | T2 | | | | | | | T3 | | +----+ | | | T2:2 executors for Bolts with total 4 tasks | | +------+ +--------+ | | Topologybuilder.setbolt ("T2-bolt", New T2bolt (), 2) | | | | . Setnumtasks (4). shufflegrouping ("T1-spout"); | | +------+ +--------+ | | T3:6 Executors for Bolts (default 1 task for 1 executor) | | | T3 | | T1 | | | TopologyBuilder.setbolt ("T3-bolt", New T3bolt (), 6). Shufflegrouping ("T2-bolt"); | | +------+ +--------+ | | | ------------------------ | Stormsubmitter.submittopology ("Sample-topology", conf, Topologybuilder.createtopology ()); ==============================
Description
A worker process generates n threads (executor), so the degree of parallelism (parallelism) is the number of all threads. Setnumworkers
A task is the work queue that the thread executes, and the number of tasks for the thread describes the throughput capacity of the thread. The individual tasks of a thread are not concurrent. Setnumtasks
A thread (executor) is the context in which the task is performed.
Refer to understanding the meanings of each configuration.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Storm Configuration Graphic Parsing