metrictank: Index | Files

package cassandra

import ""


Package Files

cassandra.go config.go


var CliConfig = NewIdxConfig()

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

func ConfigProcess Uses

func ConfigProcess()

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

func ConfigSetup Uses

func ConfigSetup() *flag.FlagSet

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

type CasIdx Uses

type CasIdx struct {
    Config *IdxConfig

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

CasIdx implements the the "MetricIndex" interface

func New Uses

func New(cfg *IdxConfig) *CasIdx

func (*CasIdx) AddOrUpdate Uses

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

func (*CasIdx) ArchiveDefs Uses

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 Uses

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

func (*CasIdx) DeleteTagged Uses

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

func (*CasIdx) Find Uses

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

func (*CasIdx) Init Uses

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 Uses

func (c *CasIdx) InitBare() error

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

func (*CasIdx) Load Uses

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

func (*CasIdx) LoadPartitions Uses

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 Uses

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

func (*CasIdx) Stop Uses

func (c *CasIdx) Stop()

func (*CasIdx) Update Uses

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 Uses

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 Uses

func NewIdxConfig() *IdxConfig

NewIdxConfig returns IdxConfig with default values set.

func (*IdxConfig) Validate Uses

func (cfg *IdxConfig) Validate() error

Validate validates IdxConfig settings

Package cassandra imports 21 packages (graph). Updated 2020-03-18. Refresh now. Tools for package owners.