Documentation ¶
Index ¶
- Variables
- func ReadBatch(i EntryIterator, size uint32) (*logproto.QueryResponse, uint32, error)
- func ReadSampleBatch(i SampleIterator, size uint32) (*logproto.SampleQueryResponse, uint32, error)
- type CacheEntryIterator
- type CacheSampleIterator
- type EntryIterator
- func EntryIteratorWithClose(it EntryIterator, closeFn func() error) EntryIterator
- func NewCategorizeLabelsIterator(wrap EntryIterator) EntryIterator
- func NewEntryReversedIter(it EntryIterator) (EntryIterator, error)
- func NewNonOverlappingIterator(iterators []EntryIterator) EntryIterator
- func NewQueryClientIterator(client logproto.Querier_QueryClient, direction logproto.Direction) EntryIterator
- func NewQueryResponseIterator(resp *logproto.QueryResponse, direction logproto.Direction) EntryIterator
- func NewReversedIter(it EntryIterator, limit uint32, preload bool) (EntryIterator, error)
- func NewSortEntryIterator(is []EntryIterator, direction logproto.Direction) EntryIterator
- func NewStreamIterator(stream logproto.Stream) EntryIterator
- func NewStreamsIterator(streams []logproto.Stream, direction logproto.Direction) EntryIterator
- func NewTimeRangedIterator(it EntryIterator, mint, maxt time.Time) EntryIterator
- type MergeEntryIterator
- type PeekingEntryIterator
- type PeekingSampleIterator
- type QuerySampleClient
- type SampleIterator
- func NewMergeSampleIterator(ctx context.Context, is []SampleIterator) SampleIterator
- func NewMultiSeriesIterator(series []logproto.Series) SampleIterator
- func NewNonOverlappingSampleIterator(iterators []SampleIterator) SampleIterator
- func NewSampleQueryClientIterator(client QuerySampleClient) SampleIterator
- func NewSampleQueryResponseIterator(resp *logproto.SampleQueryResponse) SampleIterator
- func NewSeriesIterator(series logproto.Series) SampleIterator
- func NewSortSampleIterator(is []SampleIterator) SampleIterator
- func NewTimeRangedSampleIterator(it SampleIterator, mint, maxt int64) SampleIterator
- func SampleIteratorWithClose(it SampleIterator, closeFn func() error) SampleIterator
- type SampleIteratorHeap
- type StreamIterator
Constants ¶
This section is empty.
Variables ¶
var ErrorEntryIterator = errorIterator[logproto.Entry]{}
var ErrorSampleIterator = errorIterator[logproto.Sample]{}
var NoopEntryIterator = noOpIterator[logproto.Entry]{}
var NoopSampleIterator = noOpIterator[logproto.Sample]{}
Functions ¶
func ReadBatch ¶
func ReadBatch(i EntryIterator, size uint32) (*logproto.QueryResponse, uint32, error)
ReadBatch reads a set of entries off an iterator.
func ReadSampleBatch ¶
func ReadSampleBatch(i SampleIterator, size uint32) (*logproto.SampleQueryResponse, uint32, error)
ReadSampleBatch reads a set of entries off an iterator.
Types ¶
type CacheEntryIterator ¶
type CacheEntryIterator interface { EntryIterator Wrapped() EntryIterator Reset() }
func NewCachedIterator ¶
func NewCachedIterator(it EntryIterator, cap int) CacheEntryIterator
NewCachedIterator creates an iterator that cache iteration result and can be iterated again after closing it without re-using the underlaying iterator `it`.
type CacheSampleIterator ¶
type CacheSampleIterator interface { SampleIterator Wrapped() SampleIterator Reset() }
func NewCachedSampleIterator ¶
func NewCachedSampleIterator(it SampleIterator, cap int) CacheSampleIterator
NewCachedSampleIterator creates an iterator that cache iteration result and can be iterated again after closing it without re-using the underlaying iterator `it`.
type EntryIterator ¶
type EntryIterator StreamIterator[logproto.Entry]
func EntryIteratorWithClose ¶ added in v3.2.0
func EntryIteratorWithClose(it EntryIterator, closeFn func() error) EntryIterator
func NewCategorizeLabelsIterator ¶
func NewCategorizeLabelsIterator(wrap EntryIterator) EntryIterator
func NewEntryReversedIter ¶
func NewEntryReversedIter(it EntryIterator) (EntryIterator, error)
NewEntryReversedIter returns an iterator which loads all entries and iterates backward. The labels of entries is always empty.
func NewNonOverlappingIterator ¶
func NewNonOverlappingIterator(iterators []EntryIterator) EntryIterator
NewNonOverlappingIterator gives a chained iterator over a list of iterators.
func NewQueryClientIterator ¶
func NewQueryClientIterator(client logproto.Querier_QueryClient, direction logproto.Direction) EntryIterator
NewQueryClientIterator returns an iterator over a QueryClient.
func NewQueryResponseIterator ¶
func NewQueryResponseIterator(resp *logproto.QueryResponse, direction logproto.Direction) EntryIterator
NewQueryResponseIterator returns an iterator over a QueryResponse.
func NewReversedIter ¶
func NewReversedIter(it EntryIterator, limit uint32, preload bool) (EntryIterator, error)
NewReversedIter returns an iterator which loads all or up to N entries of an existing iterator, and then iterates over them backward. Preload entries when they are being queried with a timeout.
func NewSortEntryIterator ¶
func NewSortEntryIterator(is []EntryIterator, direction logproto.Direction) EntryIterator
NewSortEntryIterator returns a new EntryIterator that sorts entries by timestamp (depending on the direction) the input iterators. The iterator only order entries across given `is` iterators, it does not sort entries within individual iterator. This means using this iterator with a single iterator will result in the same result as the input iterator. When timestamp is equal, the iterator sorts samples by their label alphabetically.
func NewStreamIterator ¶
func NewStreamIterator(stream logproto.Stream) EntryIterator
NewStreamIterator iterates over entries in a stream.
func NewStreamsIterator ¶
func NewStreamsIterator(streams []logproto.Stream, direction logproto.Direction) EntryIterator
NewStreamsIterator returns an iterator over logproto.Stream
func NewTimeRangedIterator ¶
func NewTimeRangedIterator(it EntryIterator, mint, maxt time.Time) EntryIterator
NewTimeRangedIterator returns an iterator which filters entries by time range. Note: Only works with iterators that go forwards.
type MergeEntryIterator ¶ added in v3.2.0
type MergeEntryIterator interface { EntryIterator Peek() time.Time IsEmpty() bool Push(EntryIterator) }
MergeEntryIterator exposes additional fields that are used by the Tailer only. Not safe for concurrent use!
func NewMergeEntryIterator ¶
func NewMergeEntryIterator(ctx context.Context, is []EntryIterator, direction logproto.Direction) MergeEntryIterator
NewMergeEntryIterator returns a new iterator which uses a looser tree to merge together entries for multiple iterators and deduplicate entries if any. The iterator only order and merge entries across given `is` iterators, it does not merge entries within individual iterator. This means using this iterator with a single iterator will result in the same result as the input iterator. If you don't need to deduplicate entries, use `NewSortEntryIterator` instead.
type PeekingEntryIterator ¶
type PeekingEntryIterator interface { EntryIterator Peek() (string, logproto.Entry, bool) }
PeekingEntryIterator is an entry iterator that can look ahead an entry using `Peek` without advancing its cursor.
func NewPeekingIterator ¶
func NewPeekingIterator(iter EntryIterator) PeekingEntryIterator
NewPeekingIterator creates a new peeking iterator.
type PeekingSampleIterator ¶
type PeekingSampleIterator interface { SampleIterator Peek() (string, logproto.Sample, bool) }
PeekingSampleIterator is a sample iterator that can peek sample without moving the current sample.
func NewPeekingSampleIterator ¶
func NewPeekingSampleIterator(iter SampleIterator) PeekingSampleIterator
type QuerySampleClient ¶
type QuerySampleClient interface { Recv() (*logproto.SampleQueryResponse, error) Context() context.Context CloseSend() error }
QuerySampleClient is GRPC stream client with only method used by the SampleQueryClientIterator
type SampleIterator ¶
type SampleIterator StreamIterator[logproto.Sample]
func NewMergeSampleIterator ¶
func NewMergeSampleIterator(ctx context.Context, is []SampleIterator) SampleIterator
NewMergeSampleIterator returns a new iterator which uses a heap to merge together samples for multiple iterators and deduplicate if any. The iterator only order and merge entries across given `is` iterators, it does not merge entries within individual iterator. This means using this iterator with a single iterator will result in the same result as the input iterator. If you don't need to deduplicate sample, use `NewSortSampleIterator` instead.
func NewMultiSeriesIterator ¶
func NewMultiSeriesIterator(series []logproto.Series) SampleIterator
NewMultiSeriesIterator returns an iterator over multiple logproto.Series
func NewNonOverlappingSampleIterator ¶
func NewNonOverlappingSampleIterator(iterators []SampleIterator) SampleIterator
NewNonOverlappingSampleIterator gives a chained iterator over a list of iterators.
func NewSampleQueryClientIterator ¶
func NewSampleQueryClientIterator(client QuerySampleClient) SampleIterator
NewSampleQueryClientIterator returns an iterator over a QueryClient.
func NewSampleQueryResponseIterator ¶
func NewSampleQueryResponseIterator(resp *logproto.SampleQueryResponse) SampleIterator
NewSampleQueryResponseIterator returns an iterator over a SampleQueryResponse.
func NewSeriesIterator ¶
func NewSeriesIterator(series logproto.Series) SampleIterator
NewSeriesIterator iterates over sample in a series.
func NewSortSampleIterator ¶
func NewSortSampleIterator(is []SampleIterator) SampleIterator
NewSortSampleIterator returns a new SampleIterator that sorts samples by ascending timestamp the input iterators. The iterator only order sample across given `is` iterators, it does not sort samples within individual iterator. This means using this iterator with a single iterator will result in the same result as the input iterator. When timestamp is equal, the iterator sorts samples by their label alphabetically.
func NewTimeRangedSampleIterator ¶
func NewTimeRangedSampleIterator(it SampleIterator, mint, maxt int64) SampleIterator
NewTimeRangedSampleIterator returns an iterator which filters entries by time range.
func SampleIteratorWithClose ¶
func SampleIteratorWithClose(it SampleIterator, closeFn func() error) SampleIterator
type SampleIteratorHeap ¶ added in v3.2.0
type SampleIteratorHeap struct {
// contains filtered or unexported fields
}
func NewSampleIteratorHeap ¶ added in v3.2.0
func NewSampleIteratorHeap(its []SampleIterator) SampleIteratorHeap
func (SampleIteratorHeap) Len ¶ added in v3.2.0
func (h SampleIteratorHeap) Len() int
func (SampleIteratorHeap) Less ¶ added in v3.2.0
func (h SampleIteratorHeap) Less(i, j int) bool
func (SampleIteratorHeap) Peek ¶ added in v3.2.0
func (h SampleIteratorHeap) Peek() SampleIterator
func (*SampleIteratorHeap) Pop ¶ added in v3.2.0
func (h *SampleIteratorHeap) Pop() interface{}
func (*SampleIteratorHeap) Push ¶ added in v3.2.0
func (h *SampleIteratorHeap) Push(x interface{})
func (SampleIteratorHeap) Swap ¶ added in v3.2.0
func (h SampleIteratorHeap) Swap(i, j int)
type StreamIterator ¶ added in v3.2.0
type StreamIterator[T logprotoType] interface { v2.CloseIterator[T] // Labels returns the labels for the current entry. // The labels can be mutated by the query engine and not reflect the original stream. Labels() string // StreamHash returns the hash of the original stream for the current entry. StreamHash() uint64 }