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
- func NewPendingIndexItem(req *CacheRequest) *pendingIndexItem
- type CacheData
- type CacheMissError
- type CacheRequest
- type CacheStats
- type IndexBucket
- type IndexItem
- type QueryCache
- func (c *QueryCache) AbortSet(ctx context.Context, callId string, err error)
- func (c *QueryCache) ClearForConnection(ctx context.Context, connectionName string)
- func (c *QueryCache) EndSet(ctx context.Context, callId string) (err error)
- func (c *QueryCache) Get(ctx context.Context, req *CacheRequest, streamRowFunc func(row *sdkproto.Row)) error
- func (c *QueryCache) IterateSet(ctx context.Context, row *sdkproto.Row, callId string) error
- func (c *QueryCache) StartSet(_ context.Context, req *CacheRequest)
Constants ¶
View Source
const ( // Key column CacheMatch values CacheMatchSubset = "subset" CacheMatchExact = "exact" )
Variables ¶
This section is empty.
Functions ¶
func IsCacheMiss ¶
func NewPendingIndexItem ¶
func NewPendingIndexItem(req *CacheRequest) *pendingIndexItem
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 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
func (IndexItem) SatisfiedByRequest ¶ added in v5.1.4
type QueryCache ¶
type QueryCache struct { Stats *CacheStats // map of connection name to plugin schema PluginSchemaMap map[string]*grpc.PluginSchema // contains filtered or unexported fields }
func NewQueryCache ¶
func NewQueryCache(pluginName string, pluginSchemaMap map[string]*grpc.PluginSchema, maxCacheStorageMb int) (*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)
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, streamRowFunc func(row *sdkproto.Row)) error
func (*QueryCache) IterateSet ¶
func (*QueryCache) StartSet ¶
func (c *QueryCache) StartSet(_ context.Context, req *CacheRequest)
StartSet begins a streaming cache Set operation. NOTE: this mutates req
Click to show internal directories.
Click to hide internal directories.