Documentation ¶
Index ¶
- Constants
- Variables
- type Decl
- type FetchHandler
- type HealthReport
- type ID
- type Index
- func (i *Index) FindSector(id abi.SectorID, typ storiface.SectorFileType) ([]ID, error)
- func (i *Index) StorageAttach(ctx context.Context, si StorageInfo, st fsutil.FsStat) error
- func (i *Index) StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, ...) ([]StorageInfo, error)
- func (i *Index) StorageDeclareSector(ctx context.Context, storageID ID, s abi.SectorID, ft storiface.SectorFileType, ...) error
- func (i *Index) StorageDropSector(ctx context.Context, storageID ID, s abi.SectorID, ft storiface.SectorFileType) error
- func (i *Index) StorageFindSector(ctx context.Context, s abi.SectorID, ft storiface.SectorFileType, ...) ([]SectorStorageInfo, error)
- func (i *Index) StorageInfo(ctx context.Context, id ID) (StorageInfo, error)
- func (i *Index) StorageList(ctx context.Context) (map[ID][]Decl, error)
- func (i Index) StorageLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, ...) error
- func (i *Index) StorageReportHealth(ctx context.Context, id ID, report HealthReport) error
- func (i Index) StorageTryLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, ...) (bool, error)
- type Local
- func (st *Local) AcquireSector(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, ...) (storiface.SectorPaths, storiface.SectorPaths, error)
- func (st *Local) FsStat(ctx context.Context, id ID) (fsutil.FsStat, error)
- func (st *Local) Local(ctx context.Context) ([]StoragePath, error)
- func (st *Local) MoveStorage(ctx context.Context, s abi.SectorID, ssize abi.SectorSize, ...) error
- func (st *Local) OpenPath(ctx context.Context, p string) error
- func (st *Local) Redeclare(ctx context.Context) error
- func (st *Local) Remove(ctx context.Context, sid abi.SectorID, typ storiface.SectorFileType, ...) error
- func (st *Local) RemoveCopies(ctx context.Context, sid abi.SectorID, typ storiface.SectorFileType) error
- func (st *Local) Reserve(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, ...) (func(), error)
- type LocalPath
- type LocalStorage
- type LocalStorageMeta
- type Remote
- func (r *Remote) AcquireSector(ctx context.Context, s abi.SectorID, ssize abi.SectorSize, ...) (storiface.SectorPaths, storiface.SectorPaths, error)
- func (r *Remote) FsStat(ctx context.Context, id ID) (fsutil.FsStat, error)
- func (r *Remote) MoveStorage(ctx context.Context, s abi.SectorID, ssize abi.SectorSize, ...) error
- func (r *Remote) Remove(ctx context.Context, sid abi.SectorID, typ storiface.SectorFileType, ...) error
- func (r *Remote) RemoveCopies(ctx context.Context, s abi.SectorID, types storiface.SectorFileType) error
- type SectorIndex
- type SectorStorageInfo
- type StorageConfig
- type StorageInfo
- type StoragePath
- type Store
Constants ¶
View Source
const MetaFile = "sectorstore.json"
Variables ¶
View Source
var FetchTempSubdir = "fetching"
View Source
var HeartbeatInterval = 10 * time.Second
View Source
var SkippedHeartbeatThresh = HeartbeatInterval * 5
Functions ¶
This section is empty.
Types ¶
type FetchHandler ¶
type FetchHandler struct {
*Local
}
func (*FetchHandler) ServeHTTP ¶
func (handler *FetchHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HealthReport ¶
type ID ¶
type ID string
ID identifies sector storage by UUID. One sector storage should map to one
filesystem, local or networked / shared by multiple machines
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
func (*Index) FindSector ¶
func (*Index) StorageAttach ¶
func (*Index) StorageBestAlloc ¶
func (i *Index) StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, pathType storiface.PathType) ([]StorageInfo, error)
func (*Index) StorageDeclareSector ¶
func (*Index) StorageDropSector ¶
func (*Index) StorageFindSector ¶
func (i *Index) StorageFindSector(ctx context.Context, s abi.SectorID, ft storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]SectorStorageInfo, error)
func (*Index) StorageInfo ¶
func (Index) StorageLock ¶
func (i Index) StorageLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) error
func (*Index) StorageReportHealth ¶
func (Index) StorageTryLock ¶
func (i Index) StorageTryLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) (bool, error)
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
func NewLocal ¶
func NewLocal(ctx context.Context, ls LocalStorage, index SectorIndex, urls []string) (*Local, error)
func (*Local) AcquireSector ¶
func (st *Local) AcquireSector(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, existing storiface.SectorFileType, allocate storiface.SectorFileType, pathType storiface.PathType, op storiface.AcquireMode) (storiface.SectorPaths, storiface.SectorPaths, error)
func (*Local) MoveStorage ¶
func (st *Local) MoveStorage(ctx context.Context, s abi.SectorID, ssize abi.SectorSize, types storiface.SectorFileType) error
func (*Local) RemoveCopies ¶
func (*Local) Reserve ¶
func (st *Local) Reserve(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, ft storiface.SectorFileType, storageIDs storiface.SectorPaths, overheadTab map[storiface.SectorFileType]int) (func(), error)
type LocalStorage ¶
type LocalStorageMeta ¶
type LocalStorageMeta struct { ID ID // A high weight means data is more likely to be stored in this path Weight uint64 // 0 = readonly // Intermediate data for the sealing process will be stored here CanSeal bool // Finalized sectors that will be proved over time will be stored here CanStore bool }
LocalStorageMeta path/sectorstore.json
type Remote ¶
type Remote struct {
// contains filtered or unexported fields
}
func (*Remote) AcquireSector ¶
func (r *Remote) AcquireSector(ctx context.Context, s abi.SectorID, ssize abi.SectorSize, existing storiface.SectorFileType, allocate storiface.SectorFileType, pathType storiface.PathType, op storiface.AcquireMode) (storiface.SectorPaths, storiface.SectorPaths, error)
func (*Remote) MoveStorage ¶
func (r *Remote) MoveStorage(ctx context.Context, s abi.SectorID, ssize abi.SectorSize, types storiface.SectorFileType) error
func (*Remote) RemoveCopies ¶
type SectorIndex ¶
type SectorIndex interface { StorageAttach(context.Context, StorageInfo, fsutil.FsStat) error StorageInfo(context.Context, ID) (StorageInfo, error) StorageReportHealth(context.Context, ID, HealthReport) error StorageDeclareSector(ctx context.Context, storageID ID, s abi.SectorID, ft storiface.SectorFileType, primary bool) error StorageDropSector(ctx context.Context, storageID ID, s abi.SectorID, ft storiface.SectorFileType) error StorageFindSector(ctx context.Context, sector abi.SectorID, ft storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]SectorStorageInfo, error) StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, pathType storiface.PathType) ([]StorageInfo, error) // atomically acquire locks on all sector file types. close ctx to unlock StorageLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) error StorageTryLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) (bool, error) }
type SectorStorageInfo ¶
type StorageConfig ¶
type StorageConfig struct {
StoragePaths []LocalPath
}
StorageConfig .lotusstorage/storage.json
type StorageInfo ¶
type StoragePath ¶
type Store ¶
type Store interface { AcquireSector(ctx context.Context, s abi.SectorID, ssize abi.SectorSize, 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 // 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 storiface.SectorFileType) error // move sectors into storage MoveStorage(ctx context.Context, s abi.SectorID, ssize abi.SectorSize, types storiface.SectorFileType) error FsStat(ctx context.Context, id ID) (fsutil.FsStat, error) }
Click to show internal directories.
Click to hide internal directories.