In previous implementations object size limiter left checksums of parent
object payload unset. This was caused by the closure that written calculated
checksums to the child object instead of parent one.
Construct payload checksum writers in separate function in order to prevent
closure bug.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Container get wrapper implements container.Source interface
so it can be used in object service as container storage.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Default values for capacity and price will be 0, so storage node
won't be present in placement. Add these attributes if they are
not explicitly set up by user config.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Well-known attributes set up with explicit configuration
values, other attributes set up from chain of attributes.
Chain of attributes is a string, that contains keys-value pairs,
divided by semicolon. Pairs itself divided by slash.
E.g. "StorageType:HDD/RPM:7200"
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Attribute parser converts strings of attribute chain into
one-dimension array of NodeInfo attributes, that used
in network map.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Netmap source interface used by object service to build
placement based on current or previous network map.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Implement read-only local network address source. Implement function for
check if network address is local.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
In previous implementation session Storage.Get method took a v2 owner
identifier as an argument.
Change method signature to as an argument owner identifier from NeoFS SDK.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
In previous implementation traverser worked like all counts of all selectors
are equal to counts of corresponding replicas. Make traverser to take into
account select count of all replicas.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Define object writer interface. Implement payload size limiter that
restricts payload size of the object. Implement object format moulder that
fill verification fields and finalizes object structure.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Move the serialization of the address and object into separate functions and
use them in methods. Use recently implemented RawObject constructor and
method in metaFromObject function.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Remove Address type. Makes Address method of the Object to return NeoFS SDK
Address type. Makes local storage to work with NeoFS SDK object address.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
To run storage node at dev-env environment it should have
configurable parameters. To keep `cfg` structures we can
read configuration from env and yml config file with viper
and parse values such as script hashes, fees, keys into
`cfg` structures.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
JSON format is rather verbose an inconvenient to be
edited by hand. This commit implements SQL-like
language for representing placement policy.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
In the following release `neofs-cli` will be used to directly manage NeoFS Node.
All required definitions and interfaces are also moving from `neofs-api` to
`neofs-node` repository, so it's more convinient to have `neofs-cli` here.
Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>