Documentation
¶
Index ¶
- Constants
- Variables
- func NewFracInfoCache(filePath string) *fracInfoCache
- func NewFracInfoCacheFromDisk(filePath string) *fracInfoCache
- func NewFractionRegistry(active *frac.Active, sealed []*frac.Sealed, remotes []*frac.Remote) (*fractionRegistry, error)
- 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
- type List
- type Loader
- type Searcher
- type SearcherCfg
- type StateManager
- type StorageState
Constants ¶
const StateFile = "storage-state.json"
Variables ¶
var (
ErrFractionNotWritable = errors.New("fraction is not writable")
)
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
func NewFractionRegistry ¶ added in v0.65.0
func NewFractionRegistry(active *frac.Active, sealed []*frac.Sealed, remotes []*frac.Remote) (*fractionRegistry, error)
NewFractionRegistry creates and initializes a new fraction registry instance. Populates the registry with existing active, sealed and remote fractions. Rebuilds the complete fractions list in chronological order.
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
MinSealFracSize uint64
OffloadingEnabled bool
OffloadingRetention time.Duration
}
func FillConfigWithDefault ¶
type FracManager ¶
type FracManager struct {
// contains filtered or unexported fields
}
FracManager manages database fractions with lifecycle operations
func New ¶ added in v0.62.5
New creates and initializes a new fraction manager Starts all background workers:
- indexer,
- cache cleaner,
- fraction rotation
- stats updating
Returns the manager instance and a stop function to gracefully shutdown
func (*FracManager) Append ¶
Append writes documents and metadata to the active fraction Implements retry logic in case of fraction sealing during write
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() List
func (*FracManager) Oldest ¶ added in v0.62.5
func (fm *FracManager) Oldest() uint64
func (*FracManager) SealForcedForTests ¶
func (fm *FracManager) SealForcedForTests()
func (*FracManager) WaitIdleForTests ¶ added in v0.62.5
func (fm *FracManager) WaitIdleForTests()
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
func (*Searcher) SearchDocs ¶
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
}