2020-03-23 11:40:02 +00:00
|
|
|
package stores
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2020-08-16 10:40:35 +00:00
|
|
|
|
2020-09-07 03:49:10 +00:00
|
|
|
"github.com/filecoin-project/go-state-types/abi"
|
2020-08-17 13:26:18 +00:00
|
|
|
"github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
|
2020-03-23 11:40:02 +00:00
|
|
|
)
|
|
|
|
|
2020-07-06 14:13:42 +00:00
|
|
|
type PathType string
|
2020-05-26 08:25:29 +00:00
|
|
|
|
2020-05-20 16:36:46 +00:00
|
|
|
const (
|
2020-08-04 14:20:59 +00:00
|
|
|
PathStorage PathType = "storage"
|
|
|
|
PathSealing PathType = "sealing"
|
2020-05-20 16:36:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type AcquireMode string
|
2020-05-26 08:25:29 +00:00
|
|
|
|
2020-05-20 16:36:46 +00:00
|
|
|
const (
|
2020-08-04 14:20:59 +00:00
|
|
|
AcquireMove AcquireMode = "move"
|
|
|
|
AcquireCopy AcquireMode = "copy"
|
2020-05-20 16:36:46 +00:00
|
|
|
)
|
|
|
|
|
2020-03-23 11:40:02 +00:00
|
|
|
type Store interface {
|
2020-10-21 01:30:56 +00:00
|
|
|
AcquireSector(ctx context.Context, s abi.SectorID, ssize abi.SectorSize, existing SectorFileType, allocate SectorFileType, sealing PathType, op AcquireMode) (paths SectorPaths, stores SectorPaths, err error)
|
2020-05-13 18:45:14 +00:00
|
|
|
Remove(ctx context.Context, s abi.SectorID, types SectorFileType, force bool) error
|
2020-03-25 18:21:53 +00:00
|
|
|
|
2020-05-20 16:36:46 +00:00
|
|
|
// like remove, but doesn't remove the primary sector copy, nor the last
|
|
|
|
// non-primary copy if there no primary copies
|
|
|
|
RemoveCopies(ctx context.Context, s abi.SectorID, types SectorFileType) error
|
|
|
|
|
2020-03-25 18:21:53 +00:00
|
|
|
// move sectors into storage
|
2020-10-21 01:30:56 +00:00
|
|
|
MoveStorage(ctx context.Context, s abi.SectorID, ssize abi.SectorSize, types SectorFileType) error
|
2020-03-25 18:21:53 +00:00
|
|
|
|
2020-07-08 14:58:09 +00:00
|
|
|
FsStat(ctx context.Context, id ID) (fsutil.FsStat, error)
|
2020-03-23 22:43:38 +00:00
|
|
|
}
|