forked from TrueCloudLab/frostfs-api
c8054c5daa
Proposed protobuf format for Placement Policy simplifies direct editing in visual editors and import/export from other formats like JSON. Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
6.4 KiB
6.4 KiB
Protocol Documentation
Table of Contents
netmap/types.proto
Message Filter
Filter
Field | Type | Label | Description |
---|---|---|---|
name | string | Name of the filter or a reference to the named filter. '*' means application to the whole unfiltered NetworkMap At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter | |
key | string | Key to filter | |
op | Operation | Filtering operation | |
value | string | Value to match | |
filters | Filter | repeated | List of inner filters. Top level operation will be applied to the whole list. |
Message NodeInfo
NeoFS node description
Field | Type | Label | Description |
---|---|---|---|
public_key | bytes | Public key of the NeoFS node in a binary format. | |
address | string | Ways to connect to a node | |
attributes | NodeInfo.Attribute | repeated | Carries list of the NeoFS node attributes in a string key-value format. |
state | NodeInfo.State | Carries state of the NeoFS node. |
Message NodeInfo.Attribute
Attributes of the NeoFS node.
Field | Type | Label | Description |
---|---|---|---|
key | string | Key of the node attribute. | |
value | string | Value of the node attribute. | |
parents | string | repeated | Parent keys, if any Example: For City it can be Region or Country |
Message PlacementPolicy
Set of rules to select a subset of nodes able to store container's objects
Field | Type | Label | Description |
---|---|---|---|
replicas | Replica | repeated | Rules to set number of object replicas and place each one into a particular bucket |
container_backup_factor | uint32 | Container backup factor controls how deep NeoFS will search for nodes alternatives to include into container. | |
selectors | Selector | repeated | Set of Selectors to form the container's nodes subset |
filters | Filter | repeated | List of named filters to reference in selectors |
Message Replica
Exact bucket for each replica
Field | Type | Label | Description |
---|---|---|---|
count | uint32 | How many object replicas to put | |
selector | string | Named selector bucket to put in |
Message Selector
Selector
Field | Type | Label | Description |
---|---|---|---|
name | string | Selector name to reference in object placement section | |
count | uint32 | How many nodes to select from bucket | |
attribute | string | Attribute bucket to select from | |
filter | string | Filter reference to select from |
NodeInfo.State
Represents the enumeration of various states of the NeoFS node.
Name | Number | Description |
---|---|---|
UNSPECIFIED | 0 | Unknown state. |
ONLINE | 1 | Active state in the network. |
OFFLINE | 2 | Network unavailable state. |
Operation
Operations on filters
Name | Number | Description |
---|---|---|
OPERATION_UNSPECIFIED | 0 | No Operation defined |
EQ | 1 | Equal |
NE | 2 | Not Equal |
GT | 3 | Greater then |
GE | 4 | Greater or equal |
LT | 5 | Less then |
LE | 6 | Less or equal |
OR | 7 | Logical OR |
AND | 8 | Logical AND |
Scalar Value Types
.proto Type | Notes | C++ Type | Java Type | Python Type |
---|---|---|---|---|
double | double | double | float | |
float | float | float | float | |
int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int |
int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long |
uint32 | Uses variable-length encoding. | uint32 | int | int/long |
uint64 | Uses variable-length encoding. | uint64 | long | int/long |
sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int |
sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long |
fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int |
fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long |
sfixed32 | Always four bytes. | int32 | int | int |
sfixed64 | Always eight bytes. | int64 | long | int/long |
bool | bool | boolean | boolean | |
string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode |
bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str |