Documentation
¶
Overview ¶
Package query provides the query common interfaces and utilities.
Index ¶
- func AddWindow(limit, offset uint32) (uint64, bool)
- func Charge(ctx context.Context, bytes uint64) error
- func ChargeResponse(ctx context.Context, response any) error
- func ChargeResult(ctx context.Context, bytes uint64) error
- func IsUnboundedLimit(limit, offset uint32) bool
- func Refund(ctx context.Context, bytes uint64)
- func RegisterTransportRelease(ctx context.Context, release func()) func()
- func ReserveAllocation(ctx context.Context, bytes uint64) error
- func ReserveAllocationOnce(ctx context.Context, key any, bytes uint64) error
- func WithBudgetLease(ctx context.Context, lease BudgetLease) context.Context
- func WithExistingAllocationScope(ctx context.Context, scope *AllocationScope) context.Context
- type AllocationScope
- type BudgetLease
- type Span
- type Tracer
- type TransportScope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Charge ¶ added in v0.11.1
Charge accounts bytes against the active query lease before an allocation. Calls outside admitted query contexts are intentionally no-ops.
func ChargeResponse ¶ added in v0.11.1
ChargeResponse reserves estimated encoding and transport-copy space before a protobuf response is serialized. Non-protobuf replies have no payload charge.
func ChargeResult ¶ added in v0.11.1
ChargeResult accounts one retained result and its bytes before allocation. Leases without result accounting retain byte-only charging; unadmitted calls are no-ops.
func IsUnboundedLimit ¶ added in v0.11.1
IsUnboundedLimit reports historical list-all / max-limit sentinels with no offset. OAP uses Integer.MAX_VALUE (MaxInt32); some fixtures use MaxUint32. Callers should admit these as scans and bound retained results incrementally instead of pre-reserving the window.
func Refund ¶ added in v0.11.2
Refund returns bytes previously charged with Charge to the active query lease once the memory they accounted for has been released. Calls outside admitted query contexts are intentionally no-ops.
func RegisterTransportRelease ¶ added in v0.11.1
RegisterTransportRelease registers release with the transport scope in ctx. If no scope is present, release is returned unchanged. When a scope exists, the returned function is safe to defer but the scope owns the actual release.
func ReserveAllocation ¶ added in v0.12.0
ReserveAllocation reserves selected storage bytes before allocating or borrowing. Calls without a source scope leave the existing admission accounting unchanged.
func ReserveAllocationOnce ¶ added in v0.12.0
ReserveAllocationOnce accounts the current live size of a reusable selected buffer. The key must be comparable; growth reserves only the positive delta.
func WithBudgetLease ¶ added in v0.11.1
func WithBudgetLease(ctx context.Context, lease BudgetLease) context.Context
WithBudgetLease attaches a lease to a query context.
func WithExistingAllocationScope ¶ added in v0.12.0
func WithExistingAllocationScope(ctx context.Context, scope *AllocationScope) context.Context
WithExistingAllocationScope retains a source's accounting while using the current pull's cancellation and deadline.
Types ¶
type AllocationScope ¶ added in v0.12.0
type AllocationScope struct {
// contains filtered or unexported fields
}
AllocationScope holds selected native allocations until their source closes. It shares execution accounting without coupling native storage to its caller.
func AllocationScopeFromContext ¶ added in v0.12.0
func AllocationScopeFromContext(ctx context.Context) (*AllocationScope, bool)
AllocationScopeFromContext returns the selected-allocation scope, when present.
func WithAllocationScope ¶ added in v0.12.0
func WithAllocationScope(ctx context.Context, reserve func(int64) error, release func(int64)) (context.Context, *AllocationScope)
WithAllocationScope gives one source ownership of its allocation reservations.
func (*AllocationScope) Close ¶ added in v0.12.0
func (s *AllocationScope) Close() error
Close releases the source reservations exactly once.
type BudgetLease ¶ added in v0.11.1
type BudgetLease interface {
Charge(uint64) error
// Refund returns previously charged bytes; it never takes the lease below zero.
Refund(uint64)
Limit() uint64
Used() uint64
Owner() any
}
BudgetLease is a query-owned byte reservation that can charge subsequent allocations before they occur.
func BudgetLeaseFromContext ¶ added in v0.11.1
func BudgetLeaseFromContext(ctx context.Context) (BudgetLease, bool)
BudgetLeaseFromContext returns the lease attached to ctx, if any.
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span is a span of the tracer.
func (*Span) AddSubTrace ¶
AddSubTrace adds a sub trace to the span.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer is a simple tracer for query. Thread-safety: StartSpan and span mutations are thread-safe and can be called concurrently from multiple goroutines. ToProto() is safe to call concurrently with span operations - it will wait for any async operations to complete.
func (*Tracer) DeepCopy ¶ added in v0.9.0
DeepCopy creates a deep copy of the trace. This method is thread-safe and can be called concurrently with span operations. It captures a consistent snapshot of the trace tree by locking the tracer and each span as needed.
type TransportScope ¶ added in v0.11.1
type TransportScope struct {
// contains filtered or unexported fields
}
TransportScope retains query reservations until a transport has finished serializing and sending its response.
func NewTransportScope ¶ added in v0.11.1
func NewTransportScope(ctx context.Context) (context.Context, *TransportScope)
NewTransportScope returns a context carrying a scope and the scope itself.
func TransportScopeFromContext ¶ added in v0.11.1
func TransportScopeFromContext(ctx context.Context) (*TransportScope, bool)
TransportScopeFromContext returns the transport scope attached to ctx.
func (*TransportScope) Close ¶ added in v0.11.1
func (scope *TransportScope) Close()
Close releases all reservations registered with the scope exactly once.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package aggregation implements aggregation functions to statistic a range of values.
|
Package aggregation implements aggregation functions to statistic a range of values. |
|
Package executor defines the specifications accessing underlying data repositories.
|
Package executor defines the specifications accessing underlying data repositories. |
|
Package logical implements the executable operations.
|
Package logical implements the executable operations. |
|
measure
Package measure implements execution operations for querying measure data.
|
Package measure implements execution operations for querying measure data. |
|
stream
Package stream implements execution operations for querying stream data.
|
Package stream implements execution operations for querying stream data. |
|
trace
Package trace implements execution operations for querying trace data.
|
Package trace implements execution operations for querying trace data. |
|
Package model defines the structures and interfaces for query options and results.
|
Package model defines the structures and interfaces for query options and results. |
|
Package ql bridges native measure execution into QL batch consumers.
|
Package ql bridges native measure execution into QL batch consumers. |
|
Package tracelabels defines stable query trace tag keys.
|
Package tracelabels defines stable query trace tag keys. |
|
Package vectorized provides RecordBatch-based columnar execution primitives: schema, columns, operator interfaces, pipeline composition, and memory tracking.
|
Package vectorized provides RecordBatch-based columnar execution primitives: schema, columns, operator interfaces, pipeline composition, and memory tracking. |
|
frame
Package frame defines the shared, engine-agnostic non-proto columnar binary frame carried as the SendResponse.body for a vec-native query topic.
|
Package frame defines the shared, engine-agnostic non-proto columnar binary frame carried as the SendResponse.body for a vec-native query topic. |
|
measure
Package measure implements measure-specific vectorized operators (scan, cursor, extract, limit, group-by, aggregation, top, output serialization).
|
Package measure implements measure-specific vectorized operators (scan, cursor, extract, limit, group-by, aggregation, top, output serialization). |
|
measure/frame
Package frame binds the shared vec columnar frame codec (pkg/query/vectorized/frame) to the measure engine.
|
Package frame binds the shared vec columnar frame codec (pkg/query/vectorized/frame) to the measure engine. |
|
measure/plan
Package plan is the vectorized measure-query plan tree (G8).
|
Package plan is the vectorized measure-query plan tree (G8). |
|
stream
Package stream implements stream-specific vectorized query operators: the pull pipeline that scans elements into columnar batches and merges them in index or timestamp order at egress.
|
Package stream implements stream-specific vectorized query operators: the pull pipeline that scans elements into columnar batches and merges them in index or timestamp order at egress. |
|
stream/frame
Package frame binds the shared vec columnar frame codec (pkg/query/vectorized/frame) to the stream engine.
|
Package frame binds the shared vec columnar frame codec (pkg/query/vectorized/frame) to the stream engine. |
|
trace
Package trace implements trace-specific vectorized query operators: the two-phase pull pipeline that resolves trace IDs (Phase 1) and materializes spans grouped per trace (Phase 2).
|
Package trace implements trace-specific vectorized query operators: the two-phase pull pipeline that resolves trace IDs (Phase 1) and materializes spans grouped per trace (Phase 2). |