schema

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Tables are global tables
	Tables = map[string]Definition{
		"partitions":         Partitions,
		"service_names":      ServiceNames,
		"operation_names_v2": OperationNamesV2,
		"archive":            ArchiveTraces,
	}

	// PartitionTables tables split by partition
	PartitionTables = map[string]PartitionedDefinition{
		"traces":           Traces,
		"idx_service_name": ServiceNameIndex,
		"idx_service_op":   ServiceOperationIndex,
		"idx_duration":     DurationIndex,
		"idx_tag_v2":       TagIndexV2,
	}
)

Functions

func ArchiveTraces

func ArchiveTraces() []options.CreateTableOption

ArchiveTraces returns archive_traces table schema

func BuildQuery

func BuildQuery(p DbPath, queryName QueryName) string

func DurationIndex

func DurationIndex(numPartitions uint64) []options.CreateTableOption

DurationIndex returns duration_index table schema

func OperationNamesV2

func OperationNamesV2() []options.CreateTableOption

OperationNamesV2 returns operation_names_v2 table schema

func Partitions

func Partitions() []options.CreateTableOption

func ServiceNameIndex

func ServiceNameIndex(numPartitions uint64) []options.CreateTableOption

ServiceNameIndex returns service_name_index table schema

func ServiceNames

func ServiceNames() []options.CreateTableOption

ServiceNames returns service_names table schema

func ServiceOperationIndex

func ServiceOperationIndex(numPartitions uint64) []options.CreateTableOption

ServiceOperationIndex returns service_operation_index table schema

func TagIndexV2

func TagIndexV2(numPartitions uint64) []options.CreateTableOption

TagIndexV2 returns tag_index_v2 table schema

func Traces

func Traces(numPartitions uint64) []options.CreateTableOption

Traces returns traces table schema

Types

type DbPath

type DbPath struct {
	Path   string
	Folder string
}

func (DbPath) FullTable

func (p DbPath) FullTable(name string) string

FullTable returns full table name

func (DbPath) String

func (p DbPath) String() string

func (DbPath) Table

func (p DbPath) Table(name string) string

type Definition

type Definition func() []options.CreateTableOption

Definition is a list of create table options

type PartitionKey

type PartitionKey struct {
	Date     string
	Num      uint8
	IsActive bool
}

func IntersectPartList

func IntersectPartList(a, b []PartitionKey) []PartitionKey

func MakePartitionList

func MakePartitionList(start, end time.Time) []PartitionKey

func PartitionFromTime

func PartitionFromTime(t time.Time) PartitionKey

func (PartitionKey) BuildFullTableName

func (k PartitionKey) BuildFullTableName(dbPath, table string) string

func (PartitionKey) QueryParams

func (k PartitionKey) QueryParams() *table.QueryParameters

func (PartitionKey) QueryWhereParams

func (k PartitionKey) QueryWhereParams() *table.QueryParameters

func (PartitionKey) Suffix

func (k PartitionKey) Suffix() string

func (PartitionKey) TimeSpan

func (k PartitionKey) TimeSpan() (begin time.Time, end time.Time)

type PartitionedDefinition

type PartitionedDefinition func(partitionCount uint64) []options.CreateTableOption

Definition is a list of create table options

type QueryName

type QueryName int
const (
	QueryParts QueryName = iota
	QueryActiveParts
	DeletePart
	InsertPart
	UpdatePart
	DeleteAllParts
)

Jump to

Keyboard shortcuts

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