[#68] Add SAME|DISTINCT selector clause

Helps to define how selection is formed

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
Stanislav Bogatyrev 2020-09-07 14:32:37 +03:00 committed by Stanislav Bogatyrev
parent 84907f6b04
commit ea61d4e0e9
2 changed files with 35 additions and 2 deletions

View file

@ -35,6 +35,20 @@ enum Operation {
AND = 8;
}
// Selector modifier showing how the node set will be formed
// By default selector just groups by attribute into a bucket selecting nodes
// only by their hash distance.
enum Clause{
// No modifier defined. Will select nodes from bucket randomly.
CLAUSE_UNSPECIFIED = 0;
// SAME will select only nodes having the same value of bucket attribute
SAME = 1;
// DISTINCT will select nodes having different values of bucket attribute
DISTINCT = 2;
}
// Filter
message Filter {
// Name of the filter or a reference to the named filter.
@ -64,11 +78,14 @@ message Selector {
// How many nodes to select from bucket
uint32 count = 2;
// Selector modifier showing how to form a bucket
Clause clause = 3;
// Attribute bucket to select from
string attribute = 3;
string attribute = 4;
// Filter reference to select from
string filter = 4;
string filter = 5;
}
// Exact bucket for each replica

View file

@ -194,12 +194,28 @@ Selector
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | Selector name to reference in object placement section |
| count | [uint32](#uint32) | | How many nodes to select from bucket |
| clause | [Clause](#neo.fs.v2.netmap.Clause) | | Selector modifier showing how to form a bucket |
| attribute | [string](#string) | | Attribute bucket to select from |
| filter | [string](#string) | | Filter reference to select from |
<!-- end messages -->
<a name="neo.fs.v2.netmap.Clause"></a>
### Clause
Selector modifier showing how the node set will be formed
By default selector just groups by attribute into a bucket selecting nodes
only by their hash distance.
| Name | Number | Description |
| ---- | ------ | ----------- |
| CLAUSE_UNSPECIFIED | 0 | No modifier defined |
| SAME | 1 | SAME will select only nodes having the same value of bucket attribute |
| DISTINCT | 2 | DISTINCT will select nodes having different values of bucket attribute |
<a name="neo.fs.v2.netmap.NodeInfo.State"></a>
### NodeInfo.State