[#39] Makefile: Add fmt target

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-02-28 18:53:04 +03:00
parent 188f580e46
commit 4c68d92468
15 changed files with 379 additions and 364 deletions

View file

@ -52,46 +52,46 @@ enum Clause {
DISTINCT = 2;
}
// This filter will return the subset of nodes from `NetworkMap` or another filter's
// results that will satisfy filter's conditions.
// This filter will return the subset of nodes from `NetworkMap` or another
// filter's results that will satisfy filter's conditions.
message Filter {
// Name of the filter or a reference to a 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
string name = 1 [json_name = "name"];
string name = 1 [ json_name = "name" ];
// Key to filter
string key = 2 [json_name = "key"];
string key = 2 [ json_name = "key" ];
// Filtering operation
Operation op = 3 [json_name = "op"];
Operation op = 3 [ json_name = "op" ];
// Value to match
string value = 4 [json_name = "value"];
string value = 4 [ json_name = "value" ];
// List of inner filters. Top level operation will be applied to the whole
// list.
repeated Filter filters = 5 [json_name = "filters"];
repeated Filter filters = 5 [ json_name = "filters" ];
}
// Selector chooses a number of nodes from the bucket taking the nearest nodes
// to the provided `ContainerID` by hash distance.
message Selector {
// Selector name to reference in object placement section
string name = 1 [json_name = "name"];
string name = 1 [ json_name = "name" ];
// How many nodes to select from the bucket
uint32 count = 2 [json_name = "count"];
uint32 count = 2 [ json_name = "count" ];
// Selector modifier showing how to form a bucket
Clause clause = 3 [json_name = "clause"];
Clause clause = 3 [ json_name = "clause" ];
// Bucket attribute to select from
string attribute = 4 [json_name = "attribute"];
string attribute = 4 [ json_name = "attribute" ];
// Filter reference to select from
string filter = 5 [json_name = "filter"];
string filter = 5 [ json_name = "filter" ];
}
// Number of object replicas in a set of nodes from the defined selector. If no
@ -99,10 +99,10 @@ message Selector {
// default.
message Replica {
// How many object replicas to put
uint32 count = 1 [json_name = "count"];
uint32 count = 1 [ json_name = "count" ];
// Named selector bucket to put replicas
string selector = 2 [json_name = "selector"];
string selector = 2 [ json_name = "selector" ];
}
// Set of rules to select a subset of nodes from `NetworkMap` able to store
@ -111,29 +111,29 @@ message Replica {
message PlacementPolicy {
// Rules to set number of object replicas and place each one into a named
// bucket
repeated Replica replicas = 1 [json_name = "replicas"];
repeated Replica replicas = 1 [ json_name = "replicas" ];
// Container backup factor controls how deep NeoFS will search for nodes
// alternatives to include into container's nodes subset
uint32 container_backup_factor = 2 [json_name = "containerBackupFactor"];
uint32 container_backup_factor = 2 [ json_name = "containerBackupFactor" ];
// Set of Selectors to form the container's nodes subset
repeated Selector selectors = 3 [json_name = "selectors"];
repeated Selector selectors = 3 [ json_name = "selectors" ];
// List of named filters to reference in selectors
repeated Filter filters = 4 [json_name = "filters"];
repeated Filter filters = 4 [ json_name = "filters" ];
// Unique flag defines non-overlapping application for replicas
bool unique = 5 [json_name = "unique"];
bool unique = 5 [ json_name = "unique" ];
}
// NeoFS node description
message NodeInfo {
// Public key of the NeoFS node in a binary format
bytes public_key = 1 [json_name = "publicKey"];
bytes public_key = 1 [ json_name = "publicKey" ];
// Ways to connect to a node
repeated string addresses = 2 [json_name = "addresses"];
repeated string addresses = 2 [ json_name = "addresses" ];
// Administrator-defined Attributes of the NeoFS Storage Node.
//
@ -141,15 +141,15 @@ message NodeInfo {
// string. Value can't be empty.
//
// Attributes can be constructed into a chain of attributes: any attribute can
// have a parent attribute and a child attribute (except the first and the last
// one). A string representation of the chain of attributes in NeoFS Storage
// Node configuration uses ":" and "/" symbols, e.g.:
// have a parent attribute and a child attribute (except the first and the
// last one). A string representation of the chain of attributes in NeoFS
// Storage Node configuration uses ":" and "/" symbols, e.g.:
//
// `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2`
//
// Therefore the string attribute representation in the Node configuration must
// use "\:", "\/" and "\\" escaped symbols if any of them appears in an attribute's
// key or value.
// Therefore the string attribute representation in the Node configuration
// must use "\:", "\/" and "\\" escaped symbols if any of them appears in an
// attribute's key or value.
//
// Node's attributes are mostly used during Storage Policy evaluation to
// calculate object's placement and find a set of nodes satisfying policy
@ -204,20 +204,20 @@ message NodeInfo {
// corresponding section in NeoFS Technical Specification.
message Attribute {
// Key of the node attribute
string key = 1 [json_name = "key"];
string key = 1 [ json_name = "key" ];
// Value of the node attribute
string value = 2 [json_name = "value"];
string value = 2 [ json_name = "value" ];
// Parent keys, if any. For example for `City` it could be `Region` and
// `Country`.
repeated string parents = 3 [json_name = "parents"];
repeated string parents = 3 [ json_name = "parents" ];
}
// Carries list of the NeoFS node attributes in a key-value form. Key name
// must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo
// structures with duplicated attribute names or attributes with empty values
// will be considered invalid.
repeated Attribute attributes = 3 [json_name = "attributes"];
repeated Attribute attributes = 3 [ json_name = "attributes" ];
// Represents the enumeration of various states of the NeoFS node.
enum State {
@ -235,16 +235,16 @@ message NodeInfo {
}
// Carries state of the NeoFS node
State state = 4 [json_name = "state"];
State state = 4 [ json_name = "state" ];
}
// Network map structure
message Netmap {
// Network map revision number.
uint64 epoch = 1 [json_name = "epoch"];
// Network map revision number.
uint64 epoch = 1 [ json_name = "epoch" ];
// Nodes presented in network.
repeated NodeInfo nodes = 2 [json_name = "nodes"];
// Nodes presented in network.
repeated NodeInfo nodes = 2 [ json_name = "nodes" ];
}
// NeoFS network configuration
@ -285,26 +285,27 @@ message NetworkConfig {
// Value: little-endian integer. Default: 0.
message Parameter {
// Parameter key. UTF-8 encoded string
bytes key = 1 [json_name = "key"];
bytes key = 1 [ json_name = "key" ];
// Parameter value
bytes value = 2 [json_name = "value"];
bytes value = 2 [ json_name = "value" ];
}
// List of parameter values
repeated Parameter parameters = 1 [json_name = "parameters"];
repeated Parameter parameters = 1 [ json_name = "parameters" ];
}
// Information about NeoFS network
message NetworkInfo {
// Number of the current epoch in the NeoFS network
uint64 current_epoch = 1 [json_name = "currentEpoch"];
// Number of the current epoch in the NeoFS network
uint64 current_epoch = 1 [ json_name = "currentEpoch" ];
// Magic number of the sidechain of the NeoFS network
uint64 magic_number = 2 [json_name = "magicNumber"];
// Magic number of the sidechain of the NeoFS network
uint64 magic_number = 2 [ json_name = "magicNumber" ];
// MillisecondsPerBlock network parameter of the sidechain of the NeoFS network
int64 ms_per_block = 3 [json_name = "msPerBlock"];
// MillisecondsPerBlock network parameter of the sidechain of the NeoFS
// network
int64 ms_per_block = 3 [ json_name = "msPerBlock" ];
// NeoFS network configuration
NetworkConfig network_config = 4 [json_name = "networkConfig"];
// NeoFS network configuration
NetworkConfig network_config = 4 [ json_name = "networkConfig" ];
}