Versions in this module Expand all Collapse all v1 v1.0.1 Mar 1, 2020 Changes in this version + const CompleteHealthThreshold + const PageSize + const RepairHealthThreshold + const SectorSize + const StuckThreshold + const Version + var ErrFileExist = errors.New("file already exist") + var ErrUnknownFile = errors.New("file not known") + func CmpRepairPriority(h1, h2 uint32) int + type CachedHealthMetadata struct + Health uint32 + Redundancy uint32 + StuckHealth uint32 + type DxFile struct + ID FileID + func New(filePath storage.SysPath, dxPath storage.DxPath, sourcePath storage.SysPath, ...) (*DxFile, error) + func (df *DxFile) AddSector(address enode.ID, merkleRoot common.Hash, segmentIndex, sectorIndex int) error + func (df *DxFile) ApplyCachedHealthMetadata(metadata CachedHealthMetadata) error + func (df *DxFile) CipherKey() (crypto.CipherKey, error) + func (df *DxFile) Delete() error + func (df *DxFile) Deleted() bool + func (df *DxFile) DxPath() storage.DxPath + func (df *DxFile) ErasureCode() (erasurecode.ErasureCoder, error) + func (df *DxFile) FileMode() os.FileMode + func (df *DxFile) FilePath() string + func (df *DxFile) FileSize() uint64 + func (df *DxFile) GetHealth() uint32 + func (df *DxFile) GetNumStuckSegments() uint32 + func (df *DxFile) GetRedundancy() uint32 + func (df *DxFile) GetStuckByIndex(index int) bool + func (df *DxFile) GetStuckHealth() uint32 + func (df *DxFile) Health(table storage.HostHealthInfoTable) (uint32, uint32, uint32) + func (df *DxFile) HostIDs() []enode.ID + func (df *DxFile) LastTimeRecentRepair() time.Time + func (df *DxFile) LocalPath() storage.SysPath + func (df *DxFile) MarkAllHealthySegmentsAsUnstuck(table storage.HostHealthInfoTable) error + func (df *DxFile) MarkAllUnhealthySegmentsAsStuck(table storage.HostHealthInfoTable) error + func (df *DxFile) NumSegments() int + func (df *DxFile) NumStuckSegments() int + func (df *DxFile) Redundancy(table storage.HostHealthInfoTable) uint32 + func (df *DxFile) Rename(newDxFile storage.DxPath, newDxFilename storage.SysPath) error + func (df *DxFile) SectorSize() uint64 + func (df *DxFile) Sectors(segmentIndex int) ([][]*Sector, error) + func (df *DxFile) SectorsOfSegmentIndex(index int) ([][]*Sector, error) + func (df *DxFile) SegmentHealth(segmentIndex int, table storage.HostHealthInfoTable) uint32 + func (df *DxFile) SegmentSize() uint64 + func (df *DxFile) SetFileMode(mode os.FileMode) error + func (df *DxFile) SetLocalPath(path storage.SysPath) error + func (df *DxFile) SetStuckByIndex(index int, stuck bool) (err error) + func (df *DxFile) SetTimeAccess(t time.Time) error + func (df *DxFile) SetTimeLastHealthCheck(t time.Time) error + func (df *DxFile) SetTimeRecentRepair(t time.Time) error + func (df *DxFile) Snapshot() (*Snapshot, error) + func (df *DxFile) SnapshotReader() (*SnapshotReader, error) + func (df *DxFile) TimeAccess() time.Time + func (df *DxFile) TimeCreate() time.Time + func (df *DxFile) TimeLastHealthCheck() time.Time + func (df *DxFile) TimeModify() time.Time + func (df *DxFile) TimeRecentRepair() time.Time + func (df *DxFile) TimeUpdate() time.Time + func (df *DxFile) UID() FileID + func (df *DxFile) UpdateUsedHosts(used []enode.ID) error + func (df *DxFile) UploadProgress() float64 + func (df *DxFile) UploadedBytes() uint64 + type FileID [fileIDSize]byte + type FileSet struct + func NewFileSet(rootDir storage.SysPath, wal *writeaheadlog.Wal) *FileSet + func (fs *FileSet) Delete(dxPath storage.DxPath) error + func (fs *FileSet) Exists(dxPath storage.DxPath) bool + func (fs *FileSet) NewDxFile(dxPath storage.DxPath, sourcePath storage.SysPath, force bool, ...) (*FileSetEntryWithID, error) + func (fs *FileSet) NewRandomDxFile(dxPath storage.DxPath, minSectors, numSectors uint32, ecCode uint8, ...) (*FileSetEntryWithID, error) + func (fs *FileSet) Open(dxPath storage.DxPath) (*FileSetEntryWithID, error) + func (fs *FileSet) Rename(dxPath, newDxPath storage.DxPath) error + type FileSetEntryWithID struct + func (entry *FileSetEntryWithID) Close() error + func (entry *FileSetEntryWithID) CopyEntry() *FileSetEntryWithID + type Metadata struct + CipherKey []byte + CipherKeyCode uint8 + DxPath storage.DxPath + ECExtra []byte + ErasureCodeType uint8 + FileMode os.FileMode + FileSize uint64 + Health uint32 + HostTableOffset uint64 + ID FileID + LastRedundancy uint32 + LocalPath storage.SysPath + MinSectors uint32 + NumSectors uint32 + NumStuckSegments uint32 + SectorSize uint64 + SegmentOffset uint64 + StuckHealth uint32 + TimeAccess uint64 + TimeCreate uint64 + TimeLastHealthCheck uint64 + TimeModify uint64 + TimeRecentRepair uint64 + TimeUpdate uint64 + Version string + type Sector struct + HostID enode.ID + MerkleRoot common.Hash + func (s *Sector) DecodeRLP(st *rlp.Stream) error + func (s *Sector) EncodeRLP(w io.Writer) error + type Segment struct + Index uint64 + Sectors [][]*Sector + Stuck bool + func (s *Segment) DecodeRLP(st *rlp.Stream) error + func (s *Segment) EncodeRLP(w io.Writer) error + type Snapshot struct + func (s *Snapshot) CipherKey() crypto.CipherKey + func (s *Snapshot) DxPath() storage.DxPath + func (s *Snapshot) ErasureCode() erasurecode.ErasureCoder + func (s *Snapshot) FileMode() os.FileMode + func (s *Snapshot) FileSize() uint64 + func (s *Snapshot) NumSegments() uint64 + func (s *Snapshot) SectorSize() uint64 + func (s *Snapshot) Sectors(segmentIndex uint64) ([][]*Sector, error) + func (s *Snapshot) SegmentIndexByOffset(offset uint64) (uint64, uint64) + func (s *Snapshot) SegmentSize() uint64 + type SnapshotReader struct + func (sr *SnapshotReader) Close() error + func (sr *SnapshotReader) Read(b []byte) (int, error) + func (sr *SnapshotReader) Stat() (os.FileInfo, error) + type UpdateMetaData struct + Health uint32 + LastHealthCheck time.Time + NumStuckSegments uint64 + RecentRepairTime time.Time + Redundancy uint32 + Size uint64 + StuckHealth uint32 + TimeModify time.Time