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-03-23 11:40:02 +00:00
|
|
|
|
2020-09-06 16:54:00 +00:00
|
|
|
"github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
|
|
|
|
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
2020-05-20 16:36:46 +00:00
|
|
|
)
|
|
|
|
|
2020-03-23 11:40:02 +00:00
|
|
|
type Store interface {
|
2020-09-06 16:54:00 +00:00
|
|
|
AcquireSector(ctx context.Context, s abi.SectorID, spt abi.RegisteredSealProof, existing storiface.SectorFileType, allocate storiface.SectorFileType, sealing storiface.PathType, op storiface.AcquireMode) (paths storiface.SectorPaths, stores storiface.SectorPaths, err error)
|
|
|
|
Remove(ctx context.Context, s abi.SectorID, types storiface.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
|
2020-09-06 16:54:00 +00:00
|
|
|
RemoveCopies(ctx context.Context, s abi.SectorID, types storiface.SectorFileType) error
|
2020-05-20 16:36:46 +00:00
|
|
|
|
2020-03-25 18:21:53 +00:00
|
|
|
// move sectors into storage
|
2020-09-06 16:54:00 +00:00
|
|
|
MoveStorage(ctx context.Context, s abi.SectorID, spt abi.RegisteredSealProof, types storiface.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
|
|
|
}
|