Documentation
¶
Index ¶
- Variables
- func NewFracCacheFromDisk(filePath string) *sealedFracCache
- func NewLoader(config *Config, fracProvider *fractionProvider, fracCache *sealedFracCache) *loader
- func NewSealedFracCache(filePath string) *sealedFracCache
- type AsyncSearchRequest
- type AsyncSearcher
- type AsyncSearcherConfig
- 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) *sync.WaitGroup
- type CacheMaintainerMetrics
- type Config
- type FetchSearchResultRequest
- type FetchSearchResultResponse
- type Fetcher
- type FracManager
- func (fm *FracManager) Active() frac.Fraction
- func (fm *FracManager) Append(ctx context.Context, docs, metas disk.DocBlock) error
- func (fm *FracManager) GetAllFracs() List
- func (fm *FracManager) Load(ctx context.Context) error
- func (fm *FracManager) Mature() bool
- func (fm *FracManager) ResetCacheForTests()
- func (fm *FracManager) SealForcedForTests()
- func (fm *FracManager) Start()
- func (fm *FracManager) Stop()
- func (fm *FracManager) WaitIdle()
- func (fm *FracManager) Writer() *proxyFrac
- type List
- type MappingProvider
- type Searcher
- type SearcherCfg
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSealingFractionSuicided = errors.New("sealing fraction is suicided")
Functions ¶
func NewFracCacheFromDisk ¶
func NewFracCacheFromDisk(filePath string) *sealedFracCache
func NewLoader ¶
func NewLoader(config *Config, fracProvider *fractionProvider, fracCache *sealedFracCache) *loader
func NewSealedFracCache ¶
func NewSealedFracCache(filePath string) *sealedFracCache
Types ¶
type AsyncSearchRequest ¶
type AsyncSearcher ¶
type AsyncSearcher struct {
// contains filtered or unexported fields
}
func MustStartAsync ¶
func MustStartAsync(config AsyncSearcherConfig, mp MappingProvider, fm *FracManager) *AsyncSearcher
func (*AsyncSearcher) FetchSearchResult ¶
func (as *AsyncSearcher) FetchSearchResult(r FetchSearchResultRequest) (FetchSearchResultResponse, bool)
func (*AsyncSearcher) StartSearch ¶
func (as *AsyncSearcher) StartSearch(r AsyncSearchRequest) error
type AsyncSearcherConfig ¶
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) *sync.WaitGroup
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
FracLoadLimit uint64 // how many sealed fractions should fracmanager load, if 0 then loads all
ShouldReplay bool
MaintenanceDelay time.Duration
CacheCleanupDelay time.Duration
CacheGCDelay time.Duration
SealParams frac.SealParams
SortCacheSize uint64 // size for docs cache for active fraction
Fraction frac.Config
}
func FillConfigWithDefault ¶
type FetchSearchResultRequest ¶
type FetchSearchResultRequest struct {
ID string
}
type FracManager ¶
func NewFracManager ¶
func NewFracManager(cfg *Config) *FracManager
func (*FracManager) Active ¶
func (fm *FracManager) Active() frac.Fraction
func (*FracManager) GetAllFracs ¶
func (fm *FracManager) GetAllFracs() List
GetAllFracs returns a list of known fracs. 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) Mature ¶
func (fm *FracManager) Mature() bool
func (*FracManager) ResetCacheForTests ¶
func (fm *FracManager) ResetCacheForTests()
func (*FracManager) SealForcedForTests ¶
func (fm *FracManager) SealForcedForTests()
func (*FracManager) Start ¶
func (fm *FracManager) Start()
func (*FracManager) Stop ¶
func (fm *FracManager) Stop()
func (*FracManager) WaitIdle ¶
func (fm *FracManager) WaitIdle()
func (*FracManager) Writer ¶
func (fm *FracManager) Writer() *proxyFrac
type MappingProvider ¶
type Searcher ¶
type Searcher struct {
// contains filtered or unexported fields
}
func NewSearcher ¶
func NewSearcher(maxWorkersNum int, cfg SearcherCfg) *Searcher
type SearcherCfg ¶
Click to show internal directories.
Click to hide internal directories.