asyncsearcher

package
v0.75.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 30 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExportDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: "seq_db_ingestor",
		Subsystem: "async_search",
		Name:      "export_duration_seconds",
		Help:      "Time taken to export data by protocol in seconds",
		Buckets:   metric.SecondsBucketsDoublePrecision,
	}, []string{"protocol"})
	ExportSize = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: "seq_db_ingestor",
		Subsystem: "async_search",
		Name:      "export_size_bytes",
		Help:      "Size of exported data by protocol in bytes",
		Buckets:   prometheus.ExponentialBuckets(10, 3, 20),
	}, []string{"protocol"})
	CurrentExportersCount = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: "seq_db_ingestor",
		Subsystem: "async_search",
		Name:      "export_current_exporters_in_progress",
		Help:      "Current number of active exporters in progress by protocol",
	}, []string{"protocol"})
)

Functions

This section is empty.

Types

type AsyncSearchRequest

type AsyncSearchRequest struct {
	ID        string `json:"-"`
	Params    processor.SearchParams
	Query     string
	Retention time.Duration
	WithDocs  bool
}

type AsyncSearchStatus

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, fracProvider fractionAcquirer) *AsyncSearcher

func (*AsyncSearcher) CancelSearch

func (as *AsyncSearcher) CancelSearch(id string)

func (*AsyncSearcher) DeleteSearch

func (as *AsyncSearcher) DeleteSearch(id string)

func (*AsyncSearcher) FetchSearchResult

func (*AsyncSearcher) GetAsyncSearchesList

func (as *AsyncSearcher) GetAsyncSearchesList(r GetAsyncSearchesListRequest) []*AsyncSearchesListItem

func (*AsyncSearcher) StartSearch

func (as *AsyncSearcher) StartSearch(r AsyncSearchRequest, fracProvider fractionAcquirer) error

type AsyncSearcherConfig

type AsyncSearcherConfig struct {
	DataDir string
	Workers int

	MaxSize           int
	MaxSizePerRequest int
}

type AsyncSearchesListItem

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
	Error        string
}

type FetchSearchResultRequest

type FetchSearchResultRequest struct {
	ID    string
	Limit int
	Order seq.DocsOrder
}

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 GetAsyncSearchesListRequest

type GetAsyncSearchesListRequest struct {
	Status *AsyncSearchStatus
	IDs    []string
}

type MappingProvider

type MappingProvider interface {
	GetMapping() seq.Mapping
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL