bigtable

package
v0.0.0-...-15fa731 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const COLUMN_FAMILY = "idx"

Variables

View Source
var CliConfig = NewIdxConfig()

Functions

func ConfigProcess

func ConfigProcess()

func ConfigSetup

func ConfigSetup()

func DecodeRowKey

func DecodeRowKey(key string) (schema.MKey, int32, error)

DecodeRowKey takes a rowKey string and returns the corresponding MKey and partition

func FormatRowKey

func FormatRowKey(mkey schema.MKey, partition int32) string

FormatRowKey formats an MKey and partition into a rowKey

func RowToSchema

func RowToSchema(row bigtable.Row, def *schema.MetricDefinition) error

RowToSchema takes a row and unmarshals the data into the provided MetricDefinition.

func SchemaToRow

func SchemaToRow(def *schema.MetricDefinition) (string, map[string][]byte)

SchemaToRow takes a metricDefintion and returns a rowKey and column data.

Types

type BigtableIdx

type BigtableIdx struct {
	memory.MemoryIndex
	// contains filtered or unexported fields
}

func New

func New(cfg *IdxConfig) *BigtableIdx

func (*BigtableIdx) AddOrUpdate

func (b *BigtableIdx) AddOrUpdate(mkey schema.MKey, data *schema.MetricData, partition int32) (idx.Archive, int32, bool)

func (*BigtableIdx) Delete

func (b *BigtableIdx) Delete(orgId uint32, pattern string) ([]idx.Archive, error)

func (*BigtableIdx) Init

func (b *BigtableIdx) Init() error

Init makes sure the tables and columFamilies exist. It also opens the table for reads/writes. Then rebuilds the in-memory index, sets up write queues, metrics and pruning routines

func (*BigtableIdx) InitBare

func (b *BigtableIdx) InitBare() error

InitBare creates the client and makes sure the tables and columFamilies exist. It also opens the table for reads/writes.

func (*BigtableIdx) LoadPartition

func (b *BigtableIdx) LoadPartition(partition int32, defs []schema.MetricDefinition, now time.Time) []schema.MetricDefinition

func (*BigtableIdx) Prune

func (b *BigtableIdx) Prune(now time.Time) ([]idx.Archive, error)

func (*BigtableIdx) Stop

func (b *BigtableIdx) Stop()

func (*BigtableIdx) Update

func (b *BigtableIdx) Update(point schema.MetricPoint, partition int32) (idx.Archive, int32, bool)

Update updates an existing archive, if found. It returns whether it was found, and - if so - the (updated) existing archive and its old partition

type IdxConfig

type IdxConfig struct {
	Enabled           bool
	GcpProject        string
	BigtableInstance  string
	TableName         string
	WriteQueueSize    int
	WriteMaxFlushSize int
	WriteConcurrency  int
	UpdateBigtableIdx bool
	UpdateInterval    time.Duration

	PruneInterval time.Duration
	CreateCF      bool
	// contains filtered or unexported fields
}

func NewIdxConfig

func NewIdxConfig() *IdxConfig

return StoreConfig with default values set.

func (*IdxConfig) Validate

func (cfg *IdxConfig) Validate() error

Jump to

Keyboard shortcuts

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