2025-06-10 18:26:28 +05:30
|
|
|
package querier
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
qbtypes "github.com/SigNoz/signoz/pkg/types/querybuildertypes/querybuildertypesv5"
|
|
|
|
|
"github.com/SigNoz/signoz/pkg/valuer"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Querier interface defines the contract for querying data
|
|
|
|
|
type Querier interface {
|
|
|
|
|
QueryRange(ctx context.Context, orgID valuer.UUID, req *qbtypes.QueryRangeRequest) (*qbtypes.QueryRangeResponse, error)
|
2025-08-28 11:44:43 +05:30
|
|
|
QueryRawStream(ctx context.Context, orgID valuer.UUID, req *qbtypes.QueryRangeRequest, client *qbtypes.RawStream)
|
2025-06-10 18:26:28 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BucketCache is the interface for bucket-based caching
|
|
|
|
|
type BucketCache interface {
|
|
|
|
|
// cached portion + list of gaps to fetch
|
|
|
|
|
GetMissRanges(ctx context.Context, orgID valuer.UUID, q qbtypes.Query, step qbtypes.Step) (cached *qbtypes.Result, missing []*qbtypes.TimeRange)
|
|
|
|
|
// store fresh buckets for future hits
|
2025-06-16 23:11:28 +05:30
|
|
|
Put(ctx context.Context, orgID valuer.UUID, q qbtypes.Query, step qbtypes.Step, fresh *qbtypes.Result)
|
|
|
|
|
}
|