Documentation
¶
Index ¶
- Constants
- Variables
- func CreateSearchKey(table []byte, fdbKey []byte) (string, error)
- func FlattenObjects(data map[string]any) map[string]any
- func PackSearchFields(data *internal.TableData, collection *schema.DefaultCollection, id string) ([]byte, error)
- func UnFlattenObjects(flat map[string]any) map[string]any
- func UnpackAndSetMD(doc map[string]interface{}, tableData *internal.TableData)
- func UnpackSearchFields(doc map[string]interface{}, collection *schema.DefaultCollection) (string, *internal.TableData, map[string]interface{}, error)
- type Auth0
- type BaseQueryRunner
- type CollectionQueryRunner
- func (runner *CollectionQueryRunner) Run(ctx context.Context, tx transaction.Tx, tenant *metadata.Tenant) (*Response, context.Context, error)
- func (runner *CollectionQueryRunner) SetCreateOrUpdateCollectionReq(create *api.CreateOrUpdateCollectionRequest)
- func (runner *CollectionQueryRunner) SetDescribeCollectionReq(describe *api.DescribeCollectionRequest)
- func (runner *CollectionQueryRunner) SetDropCollectionReq(drop *api.DropCollectionRequest)
- func (runner *CollectionQueryRunner) SetListCollectionReq(list *api.ListCollectionsRequest)
- type ContentType
- type DatabaseQueryRunner
- func (runner *DatabaseQueryRunner) Run(ctx context.Context, tx transaction.Tx, tenant *metadata.Tenant) (*Response, context.Context, error)
- func (runner *DatabaseQueryRunner) SetCreateDatabaseReq(create *api.CreateDatabaseRequest)
- func (runner *DatabaseQueryRunner) SetDescribeDatabaseReq(describe *api.DescribeDatabaseRequest)
- func (runner *DatabaseQueryRunner) SetDropDatabaseReq(drop *api.DropDatabaseRequest)
- func (runner *DatabaseQueryRunner) SetListDatabaseReq(list *api.ListDatabasesRequest)
- type DatabaseRowReader
- type Datadog
- type DeleteQueryRunner
- type HitsResponse
- type InsertQueryRunner
- type MetricsQueryResp
- type NoopTxListener
- type OAuthProvider
- type ObservableProvider
- type QueryRunner
- type QueryRunnerFactory
- func (f *QueryRunnerFactory) GetCollectionQueryRunner() *CollectionQueryRunner
- func (f *QueryRunnerFactory) GetDatabaseQueryRunner() *DatabaseQueryRunner
- func (f *QueryRunnerFactory) GetDeleteQueryRunner(r *api.DeleteRequest) *DeleteQueryRunner
- func (f *QueryRunnerFactory) GetInsertQueryRunner(r *api.InsertRequest) *InsertQueryRunner
- func (f *QueryRunnerFactory) GetReplaceQueryRunner(r *api.ReplaceRequest) *ReplaceQueryRunner
- func (f *QueryRunnerFactory) GetSearchQueryRunner(r *api.SearchRequest, streaming SearchStreaming) *SearchQueryRunner
- func (f *QueryRunnerFactory) GetStreamingQueryRunner(r *api.ReadRequest, streaming Streaming) *StreamingQueryRunner
- func (f *QueryRunnerFactory) GetSubscribeQueryRunner(r *api.SubscribeRequest, streaming SubscribeStreaming) *SubscribeQueryRunner
- func (f *QueryRunnerFactory) GetUpdateQueryRunner(r *api.UpdateRequest) *UpdateQueryRunner
- type QuerySession
- type ReplaceQueryRunner
- type ReqOptions
- type Response
- type Row
- type RowReader
- type SearchIndexer
- func (i *SearchIndexer) OnPostCommit(ctx context.Context, tenant *metadata.Tenant, eventListener kv.EventListener) error
- func (i *SearchIndexer) OnPreCommit(context.Context, *metadata.Tenant, transaction.Tx, kv.EventListener) error
- func (i *SearchIndexer) OnRollback(context.Context, *metadata.Tenant, kv.EventListener)
- type SearchQueryRunner
- type SearchRowReader
- type SearchStreaming
- type Service
- type Session
- type SessionManager
- func (sessMgr *SessionManager) Create(ctx context.Context, trackVerInOwnTxn bool, instantVerTracking bool, ...) (*QuerySession, error)
- func (sessMgr *SessionManager) Execute(ctx context.Context, req *ReqOptions) (*Response, error)
- func (sessMgr *SessionManager) Get(ctx context.Context) (*QuerySession, error)
- func (sessMgr *SessionManager) Remove(ctx context.Context) error
- type SessionManagerWithMetrics
- func (m SessionManagerWithMetrics) Create(ctx context.Context, trackVerInOwnTxn bool, instantVerTracking bool, ...) (qs *QuerySession, err error)
- func (m SessionManagerWithMetrics) Execute(ctx context.Context, req *ReqOptions) (resp *Response, err error)
- func (m SessionManagerWithMetrics) Get(ctx context.Context) (qs *QuerySession, err error)
- func (m SessionManagerWithMetrics) Remove(ctx context.Context) (err error)
- type Streaming
- type StreamingQueryRunner
- type SubscribeQueryRunner
- type SubscribeStreaming
- type TxListener
- type UpdateQueryRunner
Constants ¶
const ( AcceptHeader = "Accept" ApplicationJsonHeaderVal = "application/json" DDApiKey = "DD-API-KEY" DDAppKey = "DD-APPLICATION-KEY" Query = "query" DDQueryEndpointPath = "/api/v1/query" )
Variables ¶
var (
ErrSearchIndexingFailed = fmt.Errorf("failed to index documents")
)
var (
ReservedNamespaceNames = set.New(metadata.DefaultNamespaceName, "unknown")
)
Functions ¶
func PackSearchFields ¶
func UnpackAndSetMD ¶
func UnpackSearchFields ¶
Types ¶
type Auth0 ¶
type Auth0 struct {
config.AuthConfig
}
func (Auth0) GetAccessToken ¶
func (a Auth0) GetAccessToken(req *api.GetAccessTokenRequest) (*api.GetAccessTokenResponse, error)
type BaseQueryRunner ¶
type BaseQueryRunner struct {
// contains filtered or unexported fields
}
func NewBaseQueryRunner ¶
func NewBaseQueryRunner(encoder metadata.Encoder, cdcMgr *cdc.Manager, txMgr *transaction.Manager, searchStore search.Store) *BaseQueryRunner
func (*BaseQueryRunner) GetCollections ¶
func (runner *BaseQueryRunner) GetCollections(db *metadata.Database, collName string) (*schema.DefaultCollection, error)
func (*BaseQueryRunner) GetDatabase ¶
type CollectionQueryRunner ¶
type CollectionQueryRunner struct { *BaseQueryRunner // contains filtered or unexported fields }
func (*CollectionQueryRunner) SetCreateOrUpdateCollectionReq ¶
func (runner *CollectionQueryRunner) SetCreateOrUpdateCollectionReq(create *api.CreateOrUpdateCollectionRequest)
func (*CollectionQueryRunner) SetDescribeCollectionReq ¶
func (runner *CollectionQueryRunner) SetDescribeCollectionReq(describe *api.DescribeCollectionRequest)
func (*CollectionQueryRunner) SetDropCollectionReq ¶
func (runner *CollectionQueryRunner) SetDropCollectionReq(drop *api.DropCollectionRequest)
func (*CollectionQueryRunner) SetListCollectionReq ¶
func (runner *CollectionQueryRunner) SetListCollectionReq(list *api.ListCollectionsRequest)
type DatabaseQueryRunner ¶
type DatabaseQueryRunner struct { *BaseQueryRunner // contains filtered or unexported fields }
func (*DatabaseQueryRunner) SetCreateDatabaseReq ¶
func (runner *DatabaseQueryRunner) SetCreateDatabaseReq(create *api.CreateDatabaseRequest)
func (*DatabaseQueryRunner) SetDescribeDatabaseReq ¶
func (runner *DatabaseQueryRunner) SetDescribeDatabaseReq(describe *api.DescribeDatabaseRequest)
func (*DatabaseQueryRunner) SetDropDatabaseReq ¶
func (runner *DatabaseQueryRunner) SetDropDatabaseReq(drop *api.DropDatabaseRequest)
func (*DatabaseQueryRunner) SetListDatabaseReq ¶
func (runner *DatabaseQueryRunner) SetListDatabaseReq(list *api.ListDatabasesRequest)
type DatabaseRowReader ¶
type DatabaseRowReader struct {
// contains filtered or unexported fields
}
func MakeDatabaseRowReader ¶
func MakeDatabaseRowReader(ctx context.Context, tx transaction.Tx, keys []keys.Key) (*DatabaseRowReader, error)
func (*DatabaseRowReader) Err ¶
func (d *DatabaseRowReader) Err() error
type Datadog ¶
type Datadog struct {
config.ObservabilityConfig
}
func (Datadog) QueryTimeSeriesMetrics ¶
func (dd Datadog) QueryTimeSeriesMetrics(ctx context.Context, req *api.QueryTimeSeriesMetricsRequest) (*api.QueryTimeSeriesMetricsResponse, error)
type DeleteQueryRunner ¶
type DeleteQueryRunner struct { *BaseQueryRunner // contains filtered or unexported fields }
type HitsResponse ¶
type HitsResponse struct {
Hits *[]tsApi.SearchResultHit
}
func NewHits ¶
func NewHits() *HitsResponse
func (*HitsResponse) Append ¶
func (h *HitsResponse) Append(hit tsApi.SearchResultHit)
func (*HitsResponse) Count ¶
func (h *HitsResponse) Count() int
func (*HitsResponse) GetDocument ¶
func (h *HitsResponse) GetDocument(idx int) (*map[string]interface{}, bool)
func (*HitsResponse) HasMoreHits ¶
func (h *HitsResponse) HasMoreHits(idx int) bool
type InsertQueryRunner ¶
type InsertQueryRunner struct { *BaseQueryRunner // contains filtered or unexported fields }
type MetricsQueryResp ¶
type NoopTxListener ¶
type NoopTxListener struct{}
func (*NoopTxListener) OnPostCommit ¶
func (l *NoopTxListener) OnPostCommit(context.Context, *metadata.Tenant, kv.EventListener) error
func (*NoopTxListener) OnPreCommit ¶
func (l *NoopTxListener) OnPreCommit(context.Context, *metadata.Tenant, transaction.Tx, kv.EventListener) error
func (*NoopTxListener) OnRollback ¶
func (l *NoopTxListener) OnRollback(context.Context, *metadata.Tenant, kv.EventListener)
type OAuthProvider ¶
type OAuthProvider interface {
GetAccessToken(request *api.GetAccessTokenRequest) (*api.GetAccessTokenResponse, error)
}
type ObservableProvider ¶
type ObservableProvider interface {
QueryTimeSeriesMetrics(ctx context.Context, request *api.QueryTimeSeriesMetricsRequest) (*api.QueryTimeSeriesMetricsResponse, error)
}
type QueryRunner ¶
type QueryRunner interface {
Run(ctx context.Context, tx transaction.Tx, tenant *metadata.Tenant) (*Response, context.Context, error)
}
QueryRunner is responsible for executing the current query and return the response
type QueryRunnerFactory ¶
type QueryRunnerFactory struct {
// contains filtered or unexported fields
}
QueryRunnerFactory is responsible for creating query runners for different queries
func NewQueryRunnerFactory ¶
func NewQueryRunnerFactory(txMgr *transaction.Manager, cdcMgr *cdc.Manager, searchStore search.Store) *QueryRunnerFactory
NewQueryRunnerFactory returns QueryRunnerFactory object
func (*QueryRunnerFactory) GetCollectionQueryRunner ¶
func (f *QueryRunnerFactory) GetCollectionQueryRunner() *CollectionQueryRunner
func (*QueryRunnerFactory) GetDatabaseQueryRunner ¶
func (f *QueryRunnerFactory) GetDatabaseQueryRunner() *DatabaseQueryRunner
func (*QueryRunnerFactory) GetDeleteQueryRunner ¶
func (f *QueryRunnerFactory) GetDeleteQueryRunner(r *api.DeleteRequest) *DeleteQueryRunner
func (*QueryRunnerFactory) GetInsertQueryRunner ¶
func (f *QueryRunnerFactory) GetInsertQueryRunner(r *api.InsertRequest) *InsertQueryRunner
func (*QueryRunnerFactory) GetReplaceQueryRunner ¶
func (f *QueryRunnerFactory) GetReplaceQueryRunner(r *api.ReplaceRequest) *ReplaceQueryRunner
func (*QueryRunnerFactory) GetSearchQueryRunner ¶
func (f *QueryRunnerFactory) GetSearchQueryRunner(r *api.SearchRequest, streaming SearchStreaming) *SearchQueryRunner
GetSearchQueryRunner for executing Search
func (*QueryRunnerFactory) GetStreamingQueryRunner ¶
func (f *QueryRunnerFactory) GetStreamingQueryRunner(r *api.ReadRequest, streaming Streaming) *StreamingQueryRunner
GetStreamingQueryRunner returns StreamingQueryRunner
func (*QueryRunnerFactory) GetSubscribeQueryRunner ¶
func (f *QueryRunnerFactory) GetSubscribeQueryRunner(r *api.SubscribeRequest, streaming SubscribeStreaming) *SubscribeQueryRunner
GetSubscribeQueryRunner returns SubscribeQueryRunner
func (*QueryRunnerFactory) GetUpdateQueryRunner ¶
func (f *QueryRunnerFactory) GetUpdateQueryRunner(r *api.UpdateRequest) *UpdateQueryRunner
type QuerySession ¶
type QuerySession struct {
// contains filtered or unexported fields
}
func (*QuerySession) Commit ¶
func (s *QuerySession) Commit(versionMgr *metadata.VersionHandler, incVersion bool, err error) error
func (*QuerySession) Rollback ¶
func (s *QuerySession) Rollback() error
func (*QuerySession) Run ¶
func (s *QuerySession) Run(runner QueryRunner) (*Response, context.Context, error)
type ReplaceQueryRunner ¶
type ReplaceQueryRunner struct { *BaseQueryRunner // contains filtered or unexported fields }
type ReqOptions ¶
type ReqOptions struct {
// contains filtered or unexported fields
}
ReqOptions are options used by queryLifecycle to execute a query
type SearchIndexer ¶
type SearchIndexer struct {
// contains filtered or unexported fields
}
func NewSearchIndexer ¶
func NewSearchIndexer(searchStore search.Store, tenantMgr *metadata.TenantManager) *SearchIndexer
func (*SearchIndexer) OnPostCommit ¶
func (i *SearchIndexer) OnPostCommit(ctx context.Context, tenant *metadata.Tenant, eventListener kv.EventListener) error
func (*SearchIndexer) OnPreCommit ¶
func (i *SearchIndexer) OnPreCommit(context.Context, *metadata.Tenant, transaction.Tx, kv.EventListener) error
func (*SearchIndexer) OnRollback ¶
func (i *SearchIndexer) OnRollback(context.Context, *metadata.Tenant, kv.EventListener)
type SearchQueryRunner ¶
type SearchQueryRunner struct { *BaseQueryRunner // contains filtered or unexported fields }
SearchQueryRunner is a runner used for Queries that are reads and needs to return result in streaming fashion
type SearchRowReader ¶
type SearchRowReader struct {
// contains filtered or unexported fields
}
SearchRowReader is responsible for iterating on the search results. It uses pageReader internally to read page and then iterate on documents inside hits.
func NewSearchReader ¶
func NewSearchReader(ctx context.Context, store search.Store, coll *schema.DefaultCollection, query *qsearch.Query) (*SearchRowReader, error)
func SinglePageSearchReader ¶
func (*SearchRowReader) Err ¶
func (s *SearchRowReader) Err() error
type SearchStreaming ¶
type SearchStreaming interface { api.Tigris_SearchServer }
type Service ¶
type Service interface { RegisterHTTP(router chi.Router, inproc *inprocgrpc.Channel) error RegisterGRPC(grpc *grpc.Server) error }
func GetRegisteredServices ¶
func GetRegisteredServices(kvStore kv.KeyValueStore, searchStore search.Store, tenantMgr *metadata.TenantManager, txMgr *transaction.Manager) []Service
type Session ¶
type Session interface { Create(ctx context.Context, trackVerInOwnTxn bool, instantVerTracking bool, track bool) (*QuerySession, error) Get(ctx context.Context) (*QuerySession, error) Remove(ctx context.Context) error Execute(ctx context.Context, req *ReqOptions) (*Response, error) // contains filtered or unexported methods }
type SessionManager ¶
func NewSessionManager ¶
func NewSessionManager(txMgr *transaction.Manager, tenantMgr *metadata.TenantManager, versionH *metadata.VersionHandler, listeners []TxListener, tenantTracker *metadata.CacheTracker) *SessionManager
func (*SessionManager) Create ¶
func (sessMgr *SessionManager) Create(ctx context.Context, trackVerInOwnTxn bool, instantVerTracking bool, track bool) (*QuerySession, error)
Create returns the QuerySession after creating all the necessary elements that a query execution needs. It first creates or get a tenant, read the metadata version and based on that reload the tenant cache and then finally create a transaction which will be used to execute all the query in this session.
func (*SessionManager) Execute ¶
func (sessMgr *SessionManager) Execute(ctx context.Context, req *ReqOptions) (*Response, error)
Execute is responsible to execute a query. In a way this method is managing the lifecycle of a query. For implicit transaction everything is done in this method. For explicit transaction, a session may already exist, so it only needs to run without calling Commit/Rollback.
func (*SessionManager) Get ¶
func (sessMgr *SessionManager) Get(ctx context.Context) (*QuerySession, error)
type SessionManagerWithMetrics ¶
type SessionManagerWithMetrics struct {
// contains filtered or unexported fields
}
func NewSessionManagerWithMetrics ¶
func NewSessionManagerWithMetrics(txMgr *transaction.Manager, tenantMgr *metadata.TenantManager, versionH *metadata.VersionHandler, listeners []TxListener, tenantTracker *metadata.CacheTracker) *SessionManagerWithMetrics
func (SessionManagerWithMetrics) Create ¶
func (m SessionManagerWithMetrics) Create(ctx context.Context, trackVerInOwnTxn bool, instantVerTracking bool, track bool) (qs *QuerySession, err error)
func (SessionManagerWithMetrics) Execute ¶
func (m SessionManagerWithMetrics) Execute(ctx context.Context, req *ReqOptions) (resp *Response, err error)
func (SessionManagerWithMetrics) Get ¶
func (m SessionManagerWithMetrics) Get(ctx context.Context) (qs *QuerySession, err error)
type Streaming ¶
type Streaming interface { api.Tigris_ReadServer }
Streaming is a wrapper interface for passing around for streaming reads
type StreamingQueryRunner ¶
type StreamingQueryRunner struct { *BaseQueryRunner // contains filtered or unexported fields }
StreamingQueryRunner is a runner used for Queries that are reads and needs to return result in streaming fashion
type SubscribeQueryRunner ¶
type SubscribeQueryRunner struct { *BaseQueryRunner // contains filtered or unexported fields }
type SubscribeStreaming ¶
type SubscribeStreaming interface { api.Tigris_SubscribeServer }
type TxListener ¶
type TxListener interface { // OnPreCommit is called before committing the transaction. This means this method is useful when an operation needs // to guarantee transaction atomicity. Error returned by this method will roll back the user transaction. OnPreCommit(context.Context, *metadata.Tenant, transaction.Tx, kv.EventListener) error // OnPostCommit is called after committing the transaction. This means the transaction is complete and any post // activity can happen as part of this implementation. OnPostCommit(context.Context, *metadata.Tenant, kv.EventListener) error // OnRollback is called when the user transaction is rolled back. OnRollback(context.Context, *metadata.Tenant, kv.EventListener) }
TxListener allows listening to a transaction outcome and process the events that is passed in the param accordingly.
type UpdateQueryRunner ¶
type UpdateQueryRunner struct { *BaseQueryRunner // contains filtered or unexported fields }