Documentation
¶
Index ¶
- Variables
- func NewFracInfoCache(filePath string) *fracInfoCache
- func NewFracInfoCacheFromDisk(filePath string) *fracInfoCache
- func NewLoader(config *Config, fracProvider *fractionProvider, fracCache *fracInfoCache) *loader
- type AsyncSearchRequest
- type AsyncSearchStatus
- type AsyncSearcher
- func (as *AsyncSearcher) CancelSearch(id string)
- func (as *AsyncSearcher) DeleteSearch(id string)
- func (as *AsyncSearcher) FetchSearchResult(r FetchSearchResultRequest) (FetchSearchResultResponse, bool)
- func (as *AsyncSearcher) GetAsyncSearchesList(r GetAsyncSearchesListRequest) []*AsyncSearchesListItem
- func (as *AsyncSearcher) StartSearch(r AsyncSearchRequest, fracs List) error
- type AsyncSearcherConfig
- type AsyncSearchesListItem
- 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 FetchSearchResultRequest
- type FetchSearchResultResponse
- 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) GetAllFracs() (fracs List)
- func (fm *FracManager) Load(ctx context.Context) error
- func (fm *FracManager) Mature() bool
- func (fm *FracManager) OffloadForcedForTests()
- func (fm *FracManager) OldestCT() uint64
- 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 FracType
- type GetAsyncSearchesListRequest
- 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 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 AsyncSearchRequest ¶
type AsyncSearchStatus ¶ added in v0.59.0
type AsyncSearchStatus byte
const ( AsyncSearchStatusDone AsyncSearchStatus = iota AsyncSearchStatusInProgress AsyncSearchStatusError AsyncSearchStatusCanceled )
type AsyncSearcher ¶
type AsyncSearcher struct {
// contains filtered or unexported fields
}
func MustStartAsync ¶
func MustStartAsync(config AsyncSearcherConfig, mp MappingProvider, fracs List) *AsyncSearcher
func (*AsyncSearcher) CancelSearch ¶ added in v0.59.0
func (as *AsyncSearcher) CancelSearch(id string)
func (*AsyncSearcher) DeleteSearch ¶ added in v0.59.0
func (as *AsyncSearcher) DeleteSearch(id string)
func (*AsyncSearcher) FetchSearchResult ¶
func (as *AsyncSearcher) FetchSearchResult(r FetchSearchResultRequest) (FetchSearchResultResponse, bool)
func (*AsyncSearcher) GetAsyncSearchesList ¶ added in v0.59.0
func (as *AsyncSearcher) GetAsyncSearchesList(r GetAsyncSearchesListRequest) []*AsyncSearchesListItem
func (*AsyncSearcher) StartSearch ¶
func (as *AsyncSearcher) StartSearch(r AsyncSearchRequest, fracs List) error
type AsyncSearcherConfig ¶
type AsyncSearchesListItem ¶ added in v0.59.0
type AsyncSearchesListItem struct {
ID string
Status AsyncSearchStatus
StartedAt time.Time
ExpiresAt time.Time
CanceledAt time.Time
FracsDone int
FracsInQueue int
DiskUsage int
// Search request info
AggQueries []processor.AggQuery
HistInterval uint64
Query string
From seq.MID
To seq.MID
Retention time.Duration
WithDocs bool
Size int64
}
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
FracLoadLimit uint64 // how many sealed fractions should fracmanager load, if 0 then loads all
ShouldReplay bool
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
OffloadingForced bool
OffloadingRetention time.Duration
}
func FillConfigWithDefault ¶
type FetchSearchResultResponse ¶
type FetchSearchResultResponse struct {
Status AsyncSearchStatus
QPR seq.QPR
CanceledAt time.Time
Error string
StartedAt time.Time
ExpiresAt time.Time
FracsDone int
FracsInQueue int
DiskUsage int
// Stuff that needed seq-db proxy to complete async search response.
AggQueries []processor.AggQuery
HistInterval uint64
Query string
From seq.MID
To seq.MID
Retention time.Duration
WithDocs bool
Size int64
}
type FracManager ¶
type FracManager struct {
// contains filtered or unexported fields
}
func NewFracManager ¶
func (*FracManager) Active ¶
func (fm *FracManager) Active() frac.Fraction
func (*FracManager) GetAllFracs ¶
func (fm *FracManager) GetAllFracs() (fracs List)
GetAllFracs 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) Mature ¶
func (fm *FracManager) Mature() bool
func (*FracManager) OffloadForcedForTests ¶ added in v0.60.0
func (fm *FracManager) OffloadForcedForTests()
func (*FracManager) OldestCT ¶
func (fm *FracManager) OldestCT() uint64
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 GetAsyncSearchesListRequest ¶ added in v0.59.0
type GetAsyncSearchesListRequest struct {
Status *AsyncSearchStatus
IDs []string
}
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.