api

package
v0.22.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecOptions

type ExecOptions struct {
	Remote        bool
	Profile       bool
	PreTranslated bool
	EmbeddedData  []*rows.Row
	MaxMemory     int64
}

type ExecutionRequest

type ExecutionRequest struct {
	// the id of the request
	RequestID string
	// the id of the user
	UserID string
	// time the request started
	StartTime time.Time
	// time the request finished - zero iif it has not finished
	EndTime time.Time
	// status of the request 'running' or 'complete' now, could have other values later
	Status string
	// future: if the request is waiting, the type of wait that is occuring
	WaitType string
	// future: the cumulative wait time for this request
	WaitTime time.Duration
	// futuure: if the request is waiting, the thing it is waiting on
	WaitResource string
	// future: the cululative cpu time for this request
	CPUTime time.Duration
	// the elapsed time for this request
	ElapsedTime time.Duration
	// future: the cumulative number of physical reads for this request
	Reads int64
	// future: the cumulative number of physical writes for this request
	Writes int64
	// future: the cumulative number of logical reads for this request
	LogicalReads int64
	// future: the cumulative number of rows affected for this request
	RowCount int64
	// the query plan for this request formatted in json
	Plan string
	// the sql for this request
	SQL string
}

ExecutionRequest holds data about an (sql) execution request

func (*ExecutionRequest) Copy

Copy returns a copy of the ExecutionRequest passed

type ExecutionRequestsAPI

type ExecutionRequestsAPI interface {
	// add a request
	AddRequest(requestID string, userID string, startTime time.Time, sql string) error

	// update a request
	UpdateRequest(requestID string,
		endTime time.Time,
		status string,
		waitType string,
		waitTime time.Duration,
		waitResource string,
		cpuTime time.Duration,
		reads int64,
		writes int64,
		logicalReads int64,
		rowCount int64,
		plan string) error

	// list all the requests
	ListRequests() ([]ExecutionRequest, error)

	// get a specific request
	GetRequest(requestID string) (ExecutionRequest, error)
}

ExecutionRequestsAPI defines the API for storing, updating and querying internal state around (sql) execution requests

type Executor

type Executor interface {
	Execute(context.Context, core.TableKeyer, *pql.Query, []uint64, *ExecOptions) (QueryResponse, error)
}

type QueryResponse

type QueryResponse struct {
	// Result for each top-level query call.
	// The result type differs depending on the query; types
	// include: Row, RowIdentifiers, GroupCounts, SignedRow,
	// ValCount, Pair, Pairs, bool, uint64.
	Results []any

	// Error during parsing or execution.
	Err error
}

QueryResponse represent a response from a processed query.

type Schema

type Schema interface {
	TableByName(ctx context.Context, tname core.TableName) (*core.Table, error)
	TableByID(ctx context.Context, tid core.TableID) (*core.Table, error)
	Tables(ctx context.Context) ([]*core.Table, error)
}

type SystemLayerAPI

type SystemLayerAPI interface {
	ExecutionRequests() ExecutionRequestsAPI
}

SystemLayerAPI defines an api to allow access to internal FeatureBase state

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL