tables

package
v2.33.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldIterator

type FieldIterator interface {
	Next() []byte
	HasNext() bool
}

type LookupSet

type LookupSet interface {
	LookupBytes(schema.FieldIndex, []byte) (int, error)
	LookupCode(int, int) (string, error)
}

type Samples

type Samples interface {
	SamplesView
	Add(s sample.Sample) error
	Clear()
	Len() int
}

type SamplesView

type SamplesView interface {
	Range(cb func(sample *sample.Sample))
}

type StagingTable

type StagingTable struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

StagingTable is a table structure responsible for storing samples with metrics and dimensions. StagingTable uses two Samples tables one for writes and one for reads in order to prevent lock contention.

func NewStagingTable

func NewStagingTable(s *schema.Schema, limits limits.Limits) *StagingTable

func (*StagingTable) Add

func (t *StagingTable) Add(fieldIterator FieldIterator) error

Add adds input sample in form of fields to write table. Single field could be a metric or a dimension, interpretation depend on the defined schema. Fields are interpreted in the order of fields defined in the table schema. Fields format: - metric: number represented as hex string - dimension: string representing dimension value, or in format which will be used by Field transform function

func (*StagingTable) ReadSnapshot

func (t *StagingTable) ReadSnapshot(resetLookups bool) (SamplesView, LookupSet)

ReadSnapshot creates samples read snapshot and returns view on it. Previous read snapshot will be cleared. By default returned LookupSet is nil. resetLookups determines if new instance of LookupSet should be created, old one will be returned in case of reset

,as Samples and LookupSet reset need to be done atomically this function
do both functionalities instead of separate methods

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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