Implement a VolumeEcStatus() RPC for volume servers. (#8006)
Just like `VolumeStatus()`, this call allows inspecting details for a given EC volume - including number of files and their total size.
This commit is contained in:
@@ -333,6 +333,13 @@ func (ev *EcVolume) IsTimeToDestroy() bool {
|
||||
return ev.ExpireAtSec > 0 && time.Now().Unix() > (int64(ev.ExpireAtSec)+destroyDelaySeconds)
|
||||
}
|
||||
|
||||
func (ev *EcVolume) WalkIndex(processNeedleFn func(key types.NeedleId, offset types.Offset, size types.Size) error) error {
|
||||
if ev.ecxFile == nil {
|
||||
return fmt.Errorf("no ECX file associated with EC volume %v", ev.VolumeId)
|
||||
}
|
||||
return idx.WalkIndexFile(ev.ecxFile, 0, processNeedleFn)
|
||||
}
|
||||
|
||||
func (ev *EcVolume) CheckIndex() (int64, []error) {
|
||||
if ev.ecxFile == nil {
|
||||
return 0, []error{fmt.Errorf("no ECX file associated with EC volume %v", ev.VolumeId)}
|
||||
|
||||
Reference in New Issue
Block a user