Documentation
¶
Index ¶
- Variables
- func ConfigProcess()
- func ConfigSetup() *flag.FlagSet
- type CasIdx
- func (c *CasIdx) AddOrUpdate(mkey schema.MKey, data *schema.MetricData, partition int32) (idx.Archive, int32, bool)
- func (c *CasIdx) ArchiveDefs(defs []schema.MetricDefinition) (int, error)
- func (c *CasIdx) Delete(orgId uint32, pattern string) ([]idx.Archive, error)
- func (c *CasIdx) EnsureArchiveTableExists(session *gocql.Session) error
- func (c *CasIdx) Init() error
- func (c *CasIdx) InitBare() error
- func (c *CasIdx) Load(defs []schema.MetricDefinition, now time.Time) []schema.MetricDefinition
- func (c *CasIdx) LoadPartitions(partitions []int32, defs []schema.MetricDefinition, now time.Time) []schema.MetricDefinition
- func (c *CasIdx) Prune(now time.Time) ([]idx.Archive, error)
- func (c *CasIdx) Stop()
- func (c *CasIdx) Update(point schema.MetricPoint, partition int32) (idx.Archive, int32, bool)
- type IdxConfig
Constants ¶
This section is empty.
Variables ¶
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 ¶
ConfigSetup sets up and registers a FlagSet in globalconf for cassandra index and returns it
Types ¶
type CasIdx ¶
type CasIdx struct { memory.MemoryIndex // contains filtered or unexported fields }
CasIdx implements the the "MetricIndex" interface
func (*CasIdx) AddOrUpdate ¶
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_idx table.
func (*CasIdx) EnsureArchiveTableExists ¶ added in v0.12.0
EnsureArchiveTableExists checks if the index archive table exists or not. If it does not exist and the create-keyspace flag is true, then it will create it, if it doesn't exist and the create-keyspace flag is false, then it will return an error. If the table exists then it just returns nil. The index archive table is not required for Metrictank to run, it's only required by the mt-index-prune utility to archive old metrics from the index.
func (*CasIdx) Init ¶
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 ¶
InitBare makes sure the keyspace, tables, and index exists in cassandra and creates a session
func (*CasIdx) Load ¶
func (c *CasIdx) Load(defs []schema.MetricDefinition, now time.Time) []schema.MetricDefinition
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