mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Merge pull request #46135 from DanRoscigno/add-mermaid
Use mermaid chart in dev architecture doc
This commit is contained in:
commit
d6af40a4b4
@ -198,7 +198,19 @@ Each slot can be seen as an independent state machine with the following states:
|
||||
|
||||
Note that `allocated` slot can be in two different states: `granted` and `acquired`. The former is a transitional state, that actually should be short (from the instant when a slot is allocated to a query till the moment when the up-scaling procedure is run by any thread of that query).
|
||||
|
||||
![state diagram](@site/docs/en/development/images/concurrency.png)
|
||||
```mermaid
|
||||
stateDiagram-v2
|
||||
direction LR
|
||||
[*] --> free
|
||||
free --> allocated: allocate
|
||||
state allocated {
|
||||
direction LR
|
||||
[*] --> granted
|
||||
granted --> acquired: acquire
|
||||
acquired --> [*]
|
||||
}
|
||||
allocated --> free: release
|
||||
```
|
||||
|
||||
API of `ConcurrencyControl` consists of the following functions:
|
||||
1. Create a resource allocation for a query: `auto slots = ConcurrencyControl::instance().allocate(1, max_threads);`. It will allocate at least 1 and at most `max_threads` slots. Note that the first slot is granted immediately, but the remaining slots may be granted later. Thus limit is soft, because every query will obtain at least one thread.
|
||||
|
Loading…
Reference in New Issue
Block a user