Documentation ¶
Index ¶
- Constants
- Variables
- func NewBucketClient(storageConfig Config) (chunk.BucketClient, error)
- func NewChunkClient(name string, cfg Config, schemaCfg chunk.SchemaConfig, ...) (chunk.Client, error)
- func NewIndexClient(name string, cfg Config, schemaCfg chunk.SchemaConfig, ...) (chunk.IndexClient, error)
- func NewObjectClient(name string, cfg Config) (chunk.ObjectClient, error)
- func NewStore(cfg Config, storeCfg chunk.StoreConfig, schemaCfg chunk.SchemaConfig, ...) (chunk.Store, error)
- func NewTableClient(name string, cfg Config, registerer prometheus.Registerer) (chunk.TableClient, error)
- func RegisterIndexStore(name string, indexClientFactory IndexClientFactoryFunc, ...)
- type Bytes
- type Config
- type Entry
- func (*Entry) Descriptor() ([]byte, []int)
- func (this *Entry) Equal(that interface{}) bool
- func (this *Entry) GoString() string
- func (m *Entry) Marshal() (dAtA []byte, err error)
- func (m *Entry) MarshalTo(dAtA []byte) (int, error)
- func (m *Entry) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Entry) ProtoMessage()
- func (m *Entry) Reset()
- func (m *Entry) Size() (n int)
- func (this *Entry) String() string
- func (m *Entry) Unmarshal(dAtA []byte) error
- func (m *Entry) XXX_DiscardUnknown()
- func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Entry) XXX_Merge(src proto.Message)
- func (m *Entry) XXX_Size() int
- func (m *Entry) XXX_Unmarshal(b []byte) error
- type IndexClientFactoryFunc
- type ReadBatch
- func (*ReadBatch) Descriptor() ([]byte, []int)
- func (this *ReadBatch) Equal(that interface{}) bool
- func (m *ReadBatch) GetCardinality() int32
- func (m *ReadBatch) GetEntries() []Entry
- func (m *ReadBatch) GetExpiry() int64
- func (m *ReadBatch) GetKey() string
- func (this *ReadBatch) GoString() string
- func (b ReadBatch) Iterator() chunk.ReadBatchIterator
- func (m *ReadBatch) Marshal() (dAtA []byte, err error)
- func (m *ReadBatch) MarshalTo(dAtA []byte) (int, error)
- func (m *ReadBatch) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ReadBatch) ProtoMessage()
- func (m *ReadBatch) Reset()
- func (m *ReadBatch) Size() (n int)
- func (this *ReadBatch) String() string
- func (m *ReadBatch) Unmarshal(dAtA []byte) error
- func (m *ReadBatch) XXX_DiscardUnknown()
- func (m *ReadBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ReadBatch) XXX_Merge(src proto.Message)
- func (m *ReadBatch) XXX_Size() int
- func (m *ReadBatch) XXX_Unmarshal(b []byte) error
- type StoreLimits
- type TableClientFactoryFunc
Constants ¶
const ( StorageEngineChunks = "chunks" StorageEngineBlocks = "blocks" )
Supported storage engines
Variables ¶
var ( ErrInvalidLengthCachingIndexClient = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCachingIndexClient = fmt.Errorf("proto: integer overflow") )
var Fixtures = []testutils.Fixture{ fixture{gcp.Fixtures[0]}, }
Fixtures for unit testing the caching storage.
Functions ¶
func NewBucketClient ¶
func NewBucketClient(storageConfig Config) (chunk.BucketClient, error)
NewBucketClient makes a new bucket client based on the configuration.
func NewChunkClient ¶ added in v0.7.0
func NewChunkClient(name string, cfg Config, schemaCfg chunk.SchemaConfig, registerer prometheus.Registerer) (chunk.Client, error)
NewChunkClient makes a new chunk.Client of the desired types.
func NewIndexClient ¶
func NewIndexClient(name string, cfg Config, schemaCfg chunk.SchemaConfig, registerer prometheus.Registerer) (chunk.IndexClient, error)
NewIndexClient makes a new index client of the desired type.
func NewObjectClient ¶
func NewObjectClient(name string, cfg Config) (chunk.ObjectClient, error)
NewObjectClient makes a new StorageClient of the desired types.
func NewStore ¶
func NewStore( cfg Config, storeCfg chunk.StoreConfig, schemaCfg chunk.SchemaConfig, limits StoreLimits, reg prometheus.Registerer, cacheGenNumLoader chunk.CacheGenNumLoader, logger log.Logger, ) (chunk.Store, error)
NewStore makes the storage clients based on the configuration.
func NewTableClient ¶
func NewTableClient(name string, cfg Config, registerer prometheus.Registerer) (chunk.TableClient, error)
NewTableClient makes a new table client based on the configuration.
func RegisterIndexStore ¶ added in v1.1.0
func RegisterIndexStore(name string, indexClientFactory IndexClientFactoryFunc, tableClientFactory TableClientFactoryFunc)
RegisterIndexStore is used for registering a custom index type. When an index type is registered here with same name as existing types, the registered one takes the precedence.
Types ¶
type Bytes ¶
type Bytes []byte
Bytes exists to stop proto copying the byte array
type Config ¶
type Config struct { Engine string `yaml:"engine"` AWSStorageConfig aws.StorageConfig `yaml:"aws"` AzureStorageConfig azure.BlobStorageConfig `yaml:"azure"` GCPStorageConfig gcp.Config `yaml:"bigtable"` GCSConfig gcp.GCSConfig `yaml:"gcs"` CassandraStorageConfig cassandra.Config `yaml:"cassandra"` BoltDBConfig local.BoltDBConfig `yaml:"boltdb"` FSConfig local.FSConfig `yaml:"filesystem"` Swift openstack.SwiftConfig `yaml:"swift"` IndexCacheValidity time.Duration `yaml:"index_cache_validity"` IndexQueriesCacheConfig cache.Config `yaml:"index_queries_cache_config"` DeleteStoreConfig purger.DeleteStoreConfig `yaml:"delete_store"` GrpcConfig grpc.Config `yaml:"grpc_store"` }
Config chooses which storage client to use.
func (*Config) RegisterFlags ¶
RegisterFlags adds the flags required to configure this flag set.
type Entry ¶
type Entry struct { Column Bytes `protobuf:"bytes,1,opt,name=Column,proto3,customtype=Bytes" json:"Column"` Value Bytes `protobuf:"bytes,2,opt,name=Value,proto3,customtype=Bytes" json:"Value"` }
func (*Entry) Descriptor ¶
func (*Entry) MarshalToSizedBuffer ¶ added in v0.7.0
func (*Entry) ProtoMessage ¶
func (*Entry) ProtoMessage()
func (*Entry) XXX_DiscardUnknown ¶
func (m *Entry) XXX_DiscardUnknown()
func (*Entry) XXX_Marshal ¶
func (*Entry) XXX_Unmarshal ¶
type IndexClientFactoryFunc ¶ added in v0.7.0
type IndexClientFactoryFunc func() (chunk.IndexClient, error)
IndexClientFactoryFunc defines signature of function which creates chunk.IndexClient for managing index in index store
type ReadBatch ¶
type ReadBatch struct { Entries []Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // The time at which the key expires. Expiry int64 `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"` // The number of entries; used for cardinality limiting. // entries will be empty when this is set. Cardinality int32 `protobuf:"varint,4,opt,name=cardinality,proto3" json:"cardinality,omitempty"` }
func (*ReadBatch) Descriptor ¶
func (*ReadBatch) GetCardinality ¶
func (*ReadBatch) GetEntries ¶
func (ReadBatch) Iterator ¶
func (b ReadBatch) Iterator() chunk.ReadBatchIterator
Iterator implements chunk.ReadBatch.
func (*ReadBatch) MarshalToSizedBuffer ¶ added in v0.7.0
func (*ReadBatch) ProtoMessage ¶
func (*ReadBatch) ProtoMessage()
func (*ReadBatch) XXX_DiscardUnknown ¶
func (m *ReadBatch) XXX_DiscardUnknown()
func (*ReadBatch) XXX_Marshal ¶
func (*ReadBatch) XXX_Unmarshal ¶
type StoreLimits ¶ added in v0.2.0
type StoreLimits interface { CardinalityLimit(userID string) int MaxChunksPerQuery(userID string) int MaxQueryLength(userID string) time.Duration }
StoreLimits helps get Limits specific to Queries for Stores
type TableClientFactoryFunc ¶ added in v1.1.0
type TableClientFactoryFunc func() (chunk.TableClient, error)
TableClientFactoryFunc defines signature of function which creates chunk.TableClient for managing tables in index store