Documentation ¶
Overview ¶
Package query_cache is a cache used to store query results.
Each plugin process has a single QueryCache instance which stores the data for all connections
Index ¶
- Constants
- func IsCacheMiss(err error) bool
- type CacheData
- type CacheMissError
- type CacheRequest
- type CacheStats
- type IndexBucket
- type IndexItem
- type NoSubscribersError
- type QueryCache
- func (c *QueryCache) AbortSet(ctx context.Context, callId string, err error)
- func (c *QueryCache) ClearForConnection(ctx context.Context, connectionName string) error
- func (c *QueryCache) EndSet(ctx context.Context, callId string) (err error)
- func (c *QueryCache) Get(ctx context.Context, req *CacheRequest, ...) error
- func (c *QueryCache) IterateSet(ctx context.Context, row *sdkproto.Row, callId string) error
- type QueryCacheOptions
Constants ¶
View Source
const ( // Key column CacheMatch values CacheMatchSubset = "subset" CacheMatchExact = "exact" )
View Source
const ( // cache has a default hard TTL limit of 24 hours DefaultMaxTtl = 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func IsCacheMiss ¶
Types ¶
type CacheData ¶
type CacheData interface { proto.Message *sdkproto.QueryResult | *sdkproto.IndexBucket }
type CacheMissError ¶
type CacheMissError struct{}
func (CacheMissError) Error ¶
func (CacheMissError) Error() string
type CacheRequest ¶
type CacheStats ¶
type IndexBucket ¶
type IndexBucket struct {
Items []*IndexItem
}
IndexBucket contains index items for all cache results for a given table and connection
func IndexBucketfromProto ¶
func IndexBucketfromProto(b *proto.IndexBucket) *IndexBucket
func (*IndexBucket) Append ¶
func (b *IndexBucket) Append(item *IndexItem) *IndexBucket
func (*IndexBucket) AsProto ¶
func (b *IndexBucket) AsProto() *proto.IndexBucket
func (*IndexBucket) Get ¶
func (b *IndexBucket) Get(req *CacheRequest, keyColumns map[string]*proto.KeyColumn) *IndexItem
Get finds an index item which satisfies all columns
type IndexItem ¶
type IndexItem struct { Columns []string Key string Limit int64 SortOrder []*proto.SortColumn Quals map[string]*proto.Quals InsertionTime time.Time PageCount int64 }
IndexItem stores the columns and cached index for a single cached query result note - this index item it tied to a specific table and set of quals
func NewIndexItem ¶
func NewIndexItem(req *CacheRequest) *IndexItem
type NoSubscribersError ¶ added in v5.6.0
type NoSubscribersError struct{}
func (NoSubscribersError) Error ¶ added in v5.6.0
func (NoSubscribersError) Error() string
type QueryCache ¶
type QueryCache struct { Stats *CacheStats // map of connection name to plugin schema PluginSchemaMap map[string]*grpc.PluginSchema Enabled bool // contains filtered or unexported fields }
func NewQueryCache ¶
func NewQueryCache(pluginName string, pluginSchemaMap map[string]*grpc.PluginSchema, opts *QueryCacheOptions) (*QueryCache, error)
func (*QueryCache) AbortSet ¶
func (c *QueryCache) AbortSet(ctx context.Context, callId string, err error)
func (*QueryCache) ClearForConnection ¶
func (c *QueryCache) ClearForConnection(ctx context.Context, connectionName string) error
ClearForConnection removes all cache entries for the given connection
func (*QueryCache) EndSet ¶
func (c *QueryCache) EndSet(ctx context.Context, callId string) (err error)
func (*QueryCache) Get ¶
func (c *QueryCache) Get(ctx context.Context, req *CacheRequest, streamUncachedRowFunc, streamCachedRowFunc func(row *sdkproto.Row)) error
func (*QueryCache) IterateSet ¶
type QueryCacheOptions ¶ added in v5.4.0
func NewQueryCacheOptions ¶ added in v5.4.0
func NewQueryCacheOptions(req *proto.SetCacheOptionsRequest) *QueryCacheOptions
Source Files ¶
Click to show internal directories.
Click to hide internal directories.