cassandra

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CliConfig = NewIdxConfig()

CliConfig is a cassandra IdxConfig. It is instantiated with default values which can then be changed.

Functions

func ConfigProcess

func ConfigProcess()

ConfigProcess calls IdxConfig.Validate() on CliConfig. If an error is discovered this will exit with status set to 1.

func ConfigSetup

func ConfigSetup() *flag.FlagSet

ConfigSetup sets up and registers a FlagSet in globalconf for cassandra index and returns it

Types

type CasIdx

type CasIdx struct {
	memory.MemoryIndex
	Config *IdxConfig

	Session *cassandra.Session
	// contains filtered or unexported fields
}

CasIdx implements the the "MetricIndex" interface

func New

func New(cfg *IdxConfig) *CasIdx

func (*CasIdx) AddOrUpdate

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

func (*CasIdx) ArchiveDefs added in v0.12.0

func (c *CasIdx) ArchiveDefs(defs []schema.MetricDefinition) (int, error)

ArchiveDefs writes each of the provided defs to the archive table and then deletes the defs from the metric index table.

func (*CasIdx) Delete

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

func (*CasIdx) DeleteTagged added in v1.0.0

func (c *CasIdx) DeleteTagged(orgId uint32, query tagquery.Query) ([]idx.Archive, error)

func (*CasIdx) Find added in v0.13.1

func (c *CasIdx) Find(orgId uint32, pattern string, from int64) ([]idx.Node, error)

func (*CasIdx) Init

func (c *CasIdx) Init() error

Init makes sure the needed keyspace, table, index in cassandra exists, creates the session, rebuilds the in-memory index, sets up write queues, metrics and pruning routines

func (*CasIdx) InitBare

func (c *CasIdx) InitBare() error

InitBare makes sure the keyspace, tables, and index exists in cassandra and creates a session

func (*CasIdx) Load

func (*CasIdx) LoadPartitions

func (c *CasIdx) LoadPartitions(partitions []int32, defs []schema.MetricDefinition, now time.Time) []schema.MetricDefinition

LoadPartitions appends MetricDefinitions from the given partitions to defs and returns the modified defs, honoring pruning settings relative to now

func (*CasIdx) Prune

func (c *CasIdx) Prune(now time.Time) ([]idx.Archive, error)

func (*CasIdx) Stop

func (c *CasIdx) Stop()

func (*CasIdx) Update

func (c *CasIdx) 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

	SSL                      bool
	Auth                     bool
	HostVerification         bool
	CreateKeyspace           bool
	SchemaFile               string
	Keyspace                 string
	Table                    string
	ArchiveTable             string
	Hosts                    string
	CaPath                   string
	Username                 string
	Password                 string
	Consistency              string
	Timeout                  time.Duration
	ConnectionCheckInterval  time.Duration
	ConnectionCheckTimeout   time.Duration
	NumConns                 int
	ProtoVer                 int
	DisableInitialHostLookup bool
	InitLoadConcurrency      int
	// contains filtered or unexported fields
}

IdxConfig stores configuration settings for a cassandra index

func NewIdxConfig

func NewIdxConfig() *IdxConfig

NewIdxConfig returns IdxConfig with default values set.

func (*IdxConfig) Validate

func (cfg *IdxConfig) Validate() error

Validate validates IdxConfig settings

Jump to

Keyboard shortcuts

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