Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigSetup() *flag.FlagSet
- func ConvertTimeout(timeout string, defaultUnit time.Duration) time.Duration
- type CassandraStore
- func (c *CassandraStore) Add(cwr *mdata.ChunkWriteRequest)
- func (c *CassandraStore) FindExistingTables(keyspace string) error
- func (c *CassandraStore) Search(ctx context.Context, key schema.AMKey, ttl, start, end uint32) ([]chunk.IterGen, error)
- func (c *CassandraStore) SearchTable(ctx context.Context, key schema.AMKey, table Table, start, end uint32) ([]chunk.IterGen, error)
- func (c *CassandraStore) SetTracer(t opentracing.Tracer)
- func (c *CassandraStore) Stop()
- type ChunkReadRequest
- type StoreConfig
- type TTLTables
- type Table
Constants ¶
View Source
const Month_sec = 60 * 60 * 24 * 28
View Source
const QueryFmtRead = "SELECT ts, data FROM %s WHERE key IN ? AND ts < ?"
View Source
const QueryFmtWrite = "INSERT INTO %s (key, ts, data) values(?,?,?) USING TTL ?"
View Source
const Table_name_format = `metric_%d`
Variables ¶
View Source
var CliConfig = NewStoreConfig()
Functions ¶
func ConfigSetup ¶
Types ¶
type CassandraStore ¶
type CassandraStore struct {
Session *gocql.Session
TTLTables TTLTables
// contains filtered or unexported fields
}
func NewCassandraStore ¶
func NewCassandraStore(config *StoreConfig, ttls []uint32) (*CassandraStore, error)
NewCassandraStore creates a new cassandra store, using the provided retention ttl's in seconds
func (*CassandraStore) Add ¶
func (c *CassandraStore) Add(cwr *mdata.ChunkWriteRequest)
func (*CassandraStore) FindExistingTables ¶
func (c *CassandraStore) FindExistingTables(keyspace string) error
FindExistingTables set's the store's table definitions to what it can find in the database. WARNING:
- does not set the windowSize property, because we don't know what the windowFactor was we could actually figure it based on the table definition, assuming the schema isn't tampered with, but there is no use case for this so we haven't implemented this.
- each table covers a range of TTL's. we set the TTL to the lower limit so remember the TTL might have been up to twice as much
func (*CassandraStore) Search ¶
func (c *CassandraStore) Search(ctx context.Context, key schema.AMKey, ttl, start, end uint32) ([]chunk.IterGen, error)
Basic search of cassandra in the table for given ttl start inclusive, end exclusive
func (*CassandraStore) SearchTable ¶
func (c *CassandraStore) SearchTable(ctx context.Context, key schema.AMKey, table Table, start, end uint32) ([]chunk.IterGen, error)
Basic search of cassandra in given table start inclusive, end exclusive
func (*CassandraStore) SetTracer ¶
func (c *CassandraStore) SetTracer(t opentracing.Tracer)
func (*CassandraStore) Stop ¶
func (c *CassandraStore) Stop()
type ChunkReadRequest ¶
type ChunkReadRequest struct {
// contains filtered or unexported fields
}
type StoreConfig ¶
type StoreConfig struct {
Enabled bool
Addrs string
Keyspace string
Consistency string
HostSelectionPolicy string
Timeout string
ReadConcurrency int
WriteConcurrency int
ReadQueueSize int
WriteQueueSize int
Retries int
WindowFactor int
OmitReadTimeout string
CqlProtocolVersion int
CreateKeyspace bool
DisableInitialHostLookup bool
SSL bool
CaPath string
HostVerification bool
Auth bool
Username string
Password string
SchemaFile string
}
func NewStoreConfig ¶
func NewStoreConfig() *StoreConfig
return StoreConfig with default values set.
Click to show internal directories.
Click to hide internal directories.