Documentation
¶
Index ¶
- Constants
- Variables
- func NewFracInfoCache(filePath string) *fracInfoCache
- func NewFracInfoCacheFromDisk(filePath string) *fracInfoCache
- type CacheMaintainer
- func (cm *CacheMaintainer) CreateDocBlockCache() *cache.Cache[[]byte]
- func (cm *CacheMaintainer) CreateIndexCache() *frac.IndexCache
- func (cm *CacheMaintainer) CreateSortDocsCache() *cache.Cache[[]byte]
- func (cm *CacheMaintainer) Reset()
- func (cm *CacheMaintainer) RunCleanLoop(done <-chan struct{}, cleanupInterval, gcInterval time.Duration)
- type CacheMaintainerMetrics
- type Config
- type Fetcher
- type FracManager
- func (fm *FracManager) Active() frac.Fraction
- func (fm *FracManager) Append(ctx context.Context, docs, metas storage.DocBlock) error
- func (fm *FracManager) Flags() *StateManager
- func (fm *FracManager) Fractions() (fracs List)
- func (fm *FracManager) Oldest() uint64
- func (fm *FracManager) SealForcedForTests()
- func (fm *FracManager) Start()
- func (fm *FracManager) Stop()
- func (fm *FracManager) WaitIdleForTests()
- func (fm *FracManager) Writer() *proxyFrac
- type FracType
- type List
- type Loader
- type Searcher
- type SearcherCfg
- type StateManager
- type StorageState
Constants ¶
const StateFile = "storage-state.json"
Variables ¶
var ErrSealingFractionSuicided = errors.New("sealing fraction is suicided")
Functions ¶
func NewFracInfoCache ¶ added in v0.62.1
func NewFracInfoCache(filePath string) *fracInfoCache
func NewFracInfoCacheFromDisk ¶ added in v0.62.1
func NewFracInfoCacheFromDisk(filePath string) *fracInfoCache
Types ¶
type CacheMaintainer ¶
type CacheMaintainer struct {
// contains filtered or unexported fields
}
func NewCacheMaintainer ¶
func NewCacheMaintainer(totalCacheSize, sortCacheSize uint64, metrics *CacheMaintainerMetrics) *CacheMaintainer
func (*CacheMaintainer) CreateDocBlockCache ¶
func (cm *CacheMaintainer) CreateDocBlockCache() *cache.Cache[[]byte]
func (*CacheMaintainer) CreateIndexCache ¶
func (cm *CacheMaintainer) CreateIndexCache() *frac.IndexCache
func (*CacheMaintainer) CreateSortDocsCache ¶
func (cm *CacheMaintainer) CreateSortDocsCache() *cache.Cache[[]byte]
func (*CacheMaintainer) RunCleanLoop ¶
func (cm *CacheMaintainer) RunCleanLoop(done <-chan struct{}, cleanupInterval, gcInterval time.Duration)
type CacheMaintainerMetrics ¶
type CacheMaintainerMetrics struct {
HitsTotal *prometheus.CounterVec
MissTotal *prometheus.CounterVec
PanicsTotal *prometheus.CounterVec
LockWaitsTotal *prometheus.CounterVec
WaitsTotal *prometheus.CounterVec
ReattemptsTotal *prometheus.CounterVec
SizeRead *prometheus.CounterVec
SizeOccupied *prometheus.CounterVec
SizeReleased *prometheus.CounterVec
MapsRecreated *prometheus.CounterVec
MissLatency *prometheus.CounterVec
Oldest *prometheus.GaugeVec
AddBuckets *prometheus.CounterVec
DelBuckets *prometheus.CounterVec
CleanGenerations *prometheus.CounterVec
ChangeGenerations *prometheus.CounterVec
}
func (*CacheMaintainerMetrics) GetCleanerMetrics ¶
func (m *CacheMaintainerMetrics) GetCleanerMetrics(cleanerLabel string) *cache.CleanerMetrics
func (*CacheMaintainerMetrics) GetLayerMetrics ¶
func (m *CacheMaintainerMetrics) GetLayerMetrics(layerName string) *cache.Metrics
type Config ¶
type Config struct {
DataDir string
FracSize uint64
TotalSize uint64
CacheSize uint64
ReplayWorkers int
MaintenanceDelay time.Duration
CacheCleanupDelay time.Duration
CacheGCDelay time.Duration
SealParams common.SealParams
SortCacheSize uint64 // size for docs cache for active fraction
Fraction frac.Config
OffloadingEnabled bool
OffloadingRetention time.Duration
}
func FillConfigWithDefault ¶
type FracManager ¶
type FracManager struct {
// contains filtered or unexported fields
}
func (*FracManager) Active ¶
func (fm *FracManager) Active() frac.Fraction
func (*FracManager) Flags ¶ added in v0.62.3
func (fm *FracManager) Flags() *StateManager
func (*FracManager) Fractions ¶ added in v0.62.5
func (fm *FracManager) Fractions() (fracs List)
Fractions returns a list of known fracs (local and remote).
While working with this list, it may become irrelevant (factions may, for example, be deleted). This is a valid situation, because access to the data of these factions (search and fetch) occurs under blocking (see DataProvider). This way we avoid the race.
Accessing the deleted faction data just will return an empty result.
func (*FracManager) Oldest ¶ added in v0.62.5
func (fm *FracManager) Oldest() uint64
func (*FracManager) SealForcedForTests ¶
func (fm *FracManager) SealForcedForTests()
func (*FracManager) Start ¶
func (fm *FracManager) Start()
func (*FracManager) Stop ¶
func (fm *FracManager) Stop()
func (*FracManager) WaitIdleForTests ¶ added in v0.62.5
func (fm *FracManager) WaitIdleForTests()
func (*FracManager) Writer ¶
func (fm *FracManager) Writer() *proxyFrac
type Loader ¶ added in v0.62.3
type Loader struct {
// contains filtered or unexported fields
}
Loader is responsible for loading and initializing fractions from filesystem Coordinates the process of discovering, validating, and loading all fraction types
type Searcher ¶
type Searcher struct {
// contains filtered or unexported fields
}
func NewSearcher ¶
func NewSearcher(maxWorkersNum int, cfg SearcherCfg) *Searcher
type SearcherCfg ¶
type StateManager ¶ added in v0.62.3
type StateManager struct {
// contains filtered or unexported fields
}
StateManager manages storage state with thread safety
func NewStateManager ¶ added in v0.62.3
func NewStateManager(dataDir string, defaultState StorageState) (*StateManager, error)
NewStateManager creates a new storage state manager
func (*StateManager) IsCapacityExceeded ¶ added in v0.62.3
func (m *StateManager) IsCapacityExceeded() bool
IsCapacityExceeded returns storage capacity exceeded flag
type StorageState ¶ added in v0.62.3
type StorageState struct {
CapacityExceeded bool `json:"capacity_exceeded"` // Storage capacity exceeded flag
}