Versions in this module Expand all Collapse all v1 v1.4.1 Feb 27, 2023 Changes in this version + const BackupStoreageReservation + const CHUNK_KEY + const CalibrateFactor + const CalibratePriorityMax + const CalibratePriorityNormal + const CalibratePriorityRecover + const LINEAGE_KEY + const LineageStorageOverhead + const MaximumCommitDelay + const RECOVERING_BACKUP + const RECOVERING_MAIN + const RECOVERING_NONE + const SNAPSHOT_KEY + const StorageOverhead + const StorageSignalFlagForceCommit + var Backups = 10 + var Buckets = 1 + var Concurrency = types.DownloadConcurrency + var ContextKeyLog = "log" + var ErrBackupSetForbidden = errors.New("forbidden to set backup objects") + var ErrOOStorage = errors.New("out of storage") + var ErrRecovered = errors.New("already recovered") + var ErrRecovering = errors.New("already recovering") + var ErrRecoveryInterrupted = errors.New("recovery interrupted") + var ErrTrackerNotStarted = errors.New("tracker not started") + var FunctionPrefix string + var FunctionPrefixMatcher = regexp.MustCompile(`\d+$`) + var Hasher = &util.Hasher + var LineageRecoveryContenders = 3 + var Segmentor = regexp.MustCompile(`[0-9a-f]{2}`) + var SimpleDifferenceRankSignificanceRatio = 1.0 + var SnapshotInterval = uint64(1) + func IntMax(a int, b int) int + func IntMin(a int, b int) int + func Uint64Max(a uint64, b uint64) uint64 + func Uint64Min(a uint64, b uint64) uint64 + type ChunkQueue struct + func (h *ChunkQueue) Chunk(idx int) *types.Chunk + func (h *ChunkQueue) Len() int + func (h *ChunkQueue) Less(i, j int) bool + func (h *ChunkQueue) Lock() + func (h *ChunkQueue) Peek() *types.Chunk + func (h *ChunkQueue) Pop() interface{} + func (h *ChunkQueue) Push(x interface{}) + func (h *ChunkQueue) Swap(i, j int) + func (h *ChunkQueue) Unlock() + type LineageDifferenceRank interface + AddOp func(*types.LineageOp) + IsSignificant func(float64) bool + Rank func() float64 + Reset func(float64) + type LineageStorage struct + func NewLineageStorage(id uint64, cap uint64) *LineageStorage + func (s *LineageStorage) ClearBackup() + func (s *LineageStorage) Commit() (*types.CommitOption, error) + func (s *LineageStorage) ConfigS3(bucket string, prefix string) + func (s *LineageStorage) Del(key string, reason string) *types.OpRet + func (s *LineageStorage) IsConsistent(meta *types.LineageMeta) (bool, error) + func (s *LineageStorage) Keys() <-chan string + func (s *LineageStorage) Len() int + func (s *LineageStorage) Recover(meta *types.LineageMeta) (bool, <-chan error) + func (s *LineageStorage) StartTracker() + func (s *LineageStorage) Status(short bool) (confirmedTerm uint64, status types.LineageStatus) + func (s *LineageStorage) StopTracker() error + func (s *LineageStorage) Validate(meta *types.LineageMeta) (types.LineageValidationResult, error) + type PersistHelper interface + type PersistentStorage struct + func NewPersistentStorage(id uint64, cap uint64) *PersistentStorage + func (s *PersistentStorage) ConfigS3(bucket string, prefix string) + func (s *PersistentStorage) SetRecovery(key string, chunkId string, size uint64, opts int) *types.OpRet + func (s *PersistentStorage) StartTracker() + func (s *PersistentStorage) StopTracker() error + type PersistentStorageSignal uint32 + func (sig PersistentStorageSignal) Flags() uint32 + type SimpleDifferenceRank struct + func NewSimpleDifferenceRank(backups int) *SimpleDifferenceRank + func (dr *SimpleDifferenceRank) AddOp(op *types.LineageOp) + func (dr *SimpleDifferenceRank) IsSignificant(rank float64) bool + func (dr *SimpleDifferenceRank) Rank() float64 + func (dr *SimpleDifferenceRank) Reset(rank float64) + type Storage struct + func NewStorage(id uint64, cap uint64) *Storage + func (s *Storage) ConfigLogger(lvl int, color bool) + func (s *Storage) Del(key string, reason string) *types.OpRet + func (s *Storage) Get(key string) (string, []byte, *types.OpRet) + func (s *Storage) GetStream(key string) (string, resp.AllReadCloser, *types.OpRet) + func (s *Storage) Id() uint64 + func (s *Storage) Keys() <-chan string + func (s *Storage) Len() int + func (s *Storage) Meta() types.StorageMeta + func (s *Storage) Set(key string, chunkId string, val []byte) *types.OpRet + func (s *Storage) SetStream(key string, chunkId string, valReader resp.AllReadCloser) *types.OpRet + type StorageHelper interface + type StorageMeta struct + Cap uint64 + Overhead uint64 + Rsrved uint64 + func (m *StorageMeta) BackupSize() uint64 + func (m *StorageMeta) Calibrate() + func (m *StorageMeta) Capacity() uint64 + func (m *StorageMeta) DecreaseSize(dec uint64) uint64 + func (m *StorageMeta) Effective() uint64 + func (m *StorageMeta) IncreaseSize(inc uint64) uint64 + func (m *StorageMeta) ModifiedSize() uint64 + func (m *StorageMeta) Reserved() uint64 + func (m *StorageMeta) Size() uint64 + func (m *StorageMeta) System() uint64 + func (m *StorageMeta) Waterline() uint64 + type StorageSignal interface + Flags func() uint32