[#162] Fix pre-commit warnings
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
@ -101,16 +101,16 @@ In a nutshell, a `SELECT` takes a filter result as input and outputs a specific
|
||||||
Let's see some examples
|
Let's see some examples
|
||||||
```sql
|
```sql
|
||||||
-- Selects exactly one node from the entire netmap
|
-- Selects exactly one node from the entire netmap
|
||||||
SELECT 1 FROM *
|
SELECT 1 FROM *
|
||||||
|
|
||||||
-- Same as above, but with an identifier for the selection
|
-- Same as above, but with an identifier for the selection
|
||||||
SELECT 1 FROM * AS ONE
|
SELECT 1 FROM * AS ONE
|
||||||
|
|
||||||
-- Selects two nodes from the RedOrBlueNodes filter, such that both selected nodes
|
-- Selects two nodes from the RedOrBlueNodes filter, such that both selected nodes
|
||||||
-- share the same value for the Color attribute, i.e. both red or both blue.
|
-- share the same value for the Color attribute, i.e. both red or both blue.
|
||||||
SELECT 2 IN SAME Color FROM RedOrBlueNodes
|
SELECT 2 IN SAME Color FROM RedOrBlueNodes
|
||||||
|
|
||||||
-- Selects two nodes from the RedOrBlueNodes filter, such that the selected nodes
|
-- Selects two nodes from the RedOrBlueNodes filter, such that the selected nodes
|
||||||
-- have distinct values for the Color attribute, i.e. one red and one blue.
|
-- have distinct values for the Color attribute, i.e. one red and one blue.
|
||||||
-- The selection is also given an identifier.
|
-- The selection is also given an identifier.
|
||||||
SELECT 2 IN DISTINCT Color FROM RedOrBlueNodes AS MyNodes
|
SELECT 2 IN DISTINCT Color FROM RedOrBlueNodes AS MyNodes
|
||||||
|
@ -173,18 +173,18 @@ In additional to this basic syntax, there are a couple of additional useful opti
|
||||||
|
|
||||||
### The policy playground
|
### The policy playground
|
||||||
|
|
||||||
> ℹ️ This section assumes you have an up-to-date version of the `frostfs-cli`.
|
> ℹ️ This section assumes you have an up-to-date version of the `frostfs-cli`.
|
||||||
|
|
||||||
While simple placement policies have predictable results that can be understood at a glance, more complex ones need careful consideration before deployment. In order to simplify understanding a policy's outcome and experimenting while learning, a builtin tool is provided as part of the `frostfs-cli` for this purpose: the policy playground.
|
While simple placement policies have predictable results that can be understood at a glance, more complex ones need careful consideration before deployment. In order to simplify understanding a policy's outcome and experimenting while learning, a builtin tool is provided as part of the `frostfs-cli` for this purpose: the policy playground.
|
||||||
|
|
||||||
For the remainder of this guide, we will use the policy playground to setup a virtual netmap (that is, one that doesn't require any networking or deployment) and test various policies. In order to visualize this netmap easily, each node will have three attributes: a character, a shape and a color
|
For the remainder of this guide, we will use the policy playground to setup a virtual netmap (that is, one that doesn't require any networking or deployment) and test various policies. In order to visualize this netmap easily, each node will have three attributes: a character, a shape and a color
|
||||||
|
|
||||||
![Sample Netmap](./image/sample_netmap.svg)
|
![Sample Netmap](./image/sample_netmap.svg)
|
||||||
|
|
||||||
We can start the policy playground as follows:
|
We can start the policy playground as follows:
|
||||||
```sh
|
```sh
|
||||||
$ frostfs-cli container policy-playground
|
$ frostfs-cli container policy-playground
|
||||||
>
|
>
|
||||||
```
|
```
|
||||||
|
|
||||||
Since we didn't pass any endpoint, the initial netmap is empty, which we can verify with the `ls` command (to list the nodes in the netmap):
|
Since we didn't pass any endpoint, the initial netmap is empty, which we can verify with the `ls` command (to list the nodes in the netmap):
|
||||||
|
@ -400,7 +400,7 @@ FILTER Color EQ 'Green' AS GreenNodes
|
||||||
#### Example #6
|
#### Example #6
|
||||||
```sql
|
```sql
|
||||||
REP 1 IN MyNodes
|
REP 1 IN MyNodes
|
||||||
REP 2
|
REP 2
|
||||||
CBF 2
|
CBF 2
|
||||||
SELECT 1 FROM CuteNodes AS MyNodes
|
SELECT 1 FROM CuteNodes AS MyNodes
|
||||||
FILTER (Color EQ 'Blue') AND NOT (Shape EQ 'Circle' OR Shape EQ 'Square') AS CuteNodes
|
FILTER (Color EQ 'Blue') AND NOT (Shape EQ 'Circle' OR Shape EQ 'Square') AS CuteNodes
|
||||||
|
@ -442,4 +442,4 @@ Others:
|
||||||
- `ls`: list nodes in the current netmap and their attributes
|
- `ls`: list nodes in the current netmap and their attributes
|
||||||
- `add`: add a node to the current netmap. If it already exists, it will be overwritten.
|
- `add`: add a node to the current netmap. If it already exists, it will be overwritten.
|
||||||
- `remove`: remove a node from the current netmap.
|
- `remove`: remove a node from the current netmap.
|
||||||
- `eval`: evaluate a placement policy on the current netmap.
|
- `eval`: evaluate a placement policy on the current netmap.
|
||||||
|
|