[#26] netmap: Add NOT and UNIQUE keywords #27
1 changed files with 6 additions and 0 deletions
|
@ -33,6 +33,9 @@ enum Operation {
|
|||
|
||||
// Logical AND
|
||||
AND = 8;
|
||||
|
||||
// Logical negation
|
||||
NOT = 9;
|
||||
fyrchik marked this conversation as resolved
Outdated
|
||||
}
|
||||
|
||||
// Selector modifier shows how the node set will be formed. By default selector
|
||||
|
@ -119,6 +122,9 @@ message PlacementPolicy {
|
|||
|
||||
// List of named filters to reference in selectors
|
||||
repeated Filter filters = 4 [json_name = "filters"];
|
||||
|
||||
// Unique flag defines non-overlapping application for replicas
|
||||
fyrchik marked this conversation as resolved
Outdated
fyrchik
commented
It is not necessarily consecutive. Can we make use the word It is not necessarily consecutive. Can we make use the word `non-overlapping` somewhere in this doc?
|
||||
bool unique = 5 [json_name = "unique"];
|
||||
}
|
||||
|
||||
// NeoFS node description
|
||||
|
|
Loading…
Reference in a new issue
In the task we have mentioned that we would like a new field
UnaryOperation
added to the filter.This way we can have
NOT (A EQ B)
as one filter.There are few problems to discuss
UnaryOperation
then there are two options:1.1. Embed it to
Filter
like this:Cons: very easy to support the backward compability
Pros:
name
,key
,op
,value
fields (that are used either forfilterExpr AND/OR filterExpr
or forexpr
(likeA EQ B
)) are adapted for non-existentBinaryOperation
structre. And alsounary_op
can be assigned along withop
1.2. Introduce more structrure
Cons: the structures are used how they should be. Everything is explicit
Pros: Requires total refactoring that may break the backward compability :(
proto
like that and change nothing. @fyrchik suggested interesting idea to "not know"NOT
in proto and use one trick in the parser: negate operation where NOT is in the prefix:NOT (A EQ B) AND (C GT D) = (A NE B) OR (C LE D)
but this exclusive case only for NOT