2020-08-17 09:08:11 +00:00
|
|
|
package storagegroup
|
|
|
|
|
|
|
|
import (
|
2022-12-09 11:16:24 +00:00
|
|
|
"github.com/TrueCloudLab/frostfs-api-go/v2/refs"
|
2020-08-17 09:08:11 +00:00
|
|
|
)
|
|
|
|
|
2020-08-17 12:19:36 +00:00
|
|
|
// StorageGroup is a unified structure of StorageGroup
|
|
|
|
// message from proto definition.
|
2020-08-17 09:08:11 +00:00
|
|
|
type StorageGroup struct {
|
|
|
|
size uint64
|
|
|
|
|
2020-08-20 08:04:16 +00:00
|
|
|
hash *refs.Checksum
|
2020-08-17 09:08:11 +00:00
|
|
|
|
|
|
|
exp uint64
|
|
|
|
|
2022-03-01 12:50:09 +00:00
|
|
|
members []refs.ObjectID
|
2020-08-17 09:08:11 +00:00
|
|
|
}
|
|
|
|
|
2020-08-17 12:19:36 +00:00
|
|
|
// GetValidationDataSize of unified storage group structure.
|
2020-08-17 09:08:11 +00:00
|
|
|
func (s *StorageGroup) GetValidationDataSize() uint64 {
|
|
|
|
if s != nil {
|
|
|
|
return s.size
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-08-17 12:19:36 +00:00
|
|
|
// SetValidationDataSize into unified storage group structure.
|
2020-08-17 09:08:11 +00:00
|
|
|
func (s *StorageGroup) SetValidationDataSize(v uint64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
s.size = v
|
2020-08-17 09:08:11 +00:00
|
|
|
}
|
|
|
|
|
2020-08-17 12:19:36 +00:00
|
|
|
// GetValidationHash of unified storage group structure.
|
2020-08-20 08:04:16 +00:00
|
|
|
func (s *StorageGroup) GetValidationHash() *refs.Checksum {
|
2020-08-17 09:08:11 +00:00
|
|
|
if s != nil {
|
|
|
|
return s.hash
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-08-17 12:19:36 +00:00
|
|
|
// SetValidationHash into unified storage group structure.
|
2020-08-20 08:04:16 +00:00
|
|
|
func (s *StorageGroup) SetValidationHash(v *refs.Checksum) {
|
2022-03-23 11:42:57 +00:00
|
|
|
s.hash = v
|
2020-08-17 09:08:11 +00:00
|
|
|
}
|
|
|
|
|
2020-08-17 12:19:36 +00:00
|
|
|
// GetExpirationEpoch of unified storage group structure.
|
2022-09-17 06:39:11 +00:00
|
|
|
//
|
|
|
|
// Deprecated: Do not use.
|
2020-08-17 09:08:11 +00:00
|
|
|
func (s *StorageGroup) GetExpirationEpoch() uint64 {
|
|
|
|
if s != nil {
|
|
|
|
return s.exp
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-08-17 12:19:36 +00:00
|
|
|
// SetExpirationEpoch into unified storage group structure.
|
2022-09-17 06:39:11 +00:00
|
|
|
//
|
|
|
|
// Deprecated: Do not use.
|
2020-08-17 09:08:11 +00:00
|
|
|
func (s *StorageGroup) SetExpirationEpoch(v uint64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
s.exp = v
|
2020-08-17 09:08:11 +00:00
|
|
|
}
|
|
|
|
|
2020-08-17 12:19:36 +00:00
|
|
|
// GetMembers of unified storage group structure. Members are objects of
|
|
|
|
// storage group.
|
2022-03-01 12:50:09 +00:00
|
|
|
func (s *StorageGroup) GetMembers() []refs.ObjectID {
|
2020-08-17 09:08:11 +00:00
|
|
|
if s != nil {
|
|
|
|
return s.members
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-08-17 12:19:36 +00:00
|
|
|
// SetMembers into unified storage group structure. Members are objects of
|
|
|
|
// storage group.
|
2022-03-01 12:50:09 +00:00
|
|
|
func (s *StorageGroup) SetMembers(v []refs.ObjectID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
s.members = v
|
2020-08-17 09:08:11 +00:00
|
|
|
}
|