forked from TrueCloudLab/frostfs-node
[#1064] putsvc: Add EC put
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
39da643354
commit
1c5e0f90aa
11 changed files with 452 additions and 23 deletions
20
pkg/core/policy/ec.go
Normal file
20
pkg/core/policy/ec.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package policy
|
||||
|
||||
import (
|
||||
netmapSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap"
|
||||
)
|
||||
|
||||
// IsECPlacement returns True if policy is erasure coding policy.
|
||||
func IsECPlacement(policy netmapSDK.PlacementPolicy) bool {
|
||||
return policy.NumberOfReplicas() == 1 && policy.ReplicaDescriptor(0).GetECDataCount() > 0
|
||||
}
|
||||
|
||||
// ECDataCount returns EC data count for EC placement policy.
|
||||
func ECDataCount(policy netmapSDK.PlacementPolicy) int {
|
||||
return int(policy.ReplicaDescriptor(0).GetECDataCount())
|
||||
}
|
||||
|
||||
// ECParityCount returns EC parity count for EC placement policy.
|
||||
func ECParityCount(policy netmapSDK.PlacementPolicy) int {
|
||||
return int(policy.ReplicaDescriptor(0).GetECParityCount())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue