Skip to content

Commit

Permalink
Rename AbsentOperator to just Absent
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Kartago Lamida <[email protected]>
  • Loading branch information
lamida committed Jan 28, 2025
1 parent e784b93 commit 3b6cc48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/streamingpromql/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func AbsentFunctionOperatorFactory(args []types.Operator, memoryConsumptionTrack
return nil, fmt.Errorf("expected an instant vector argument for %s, got %T", functionName, args[0])
}

var o types.InstantVectorOperator = functions.NewAbsentOperator(inner, innerExpressions[0], timeRange, expressionPosition, memoryConsumptionTracker)
var o types.InstantVectorOperator = functions.NewAbsent(inner, innerExpressions[0], timeRange, expressionPosition, memoryConsumptionTracker)

return o, nil
}
Expand Down
20 changes: 10 additions & 10 deletions pkg/streamingpromql/operators/functions/absent.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"github.com/grafana/mimir/pkg/streamingpromql/types"
)

// AbsentOperator is an operator that implements the absent() function.
type AbsentOperator struct {
// Absent is an operator that implements the absent() function.
type Absent struct {
timeRange types.QueryTimeRange
innerExpr parser.Expr
inner types.InstantVectorOperator
Expand All @@ -28,11 +28,11 @@ type AbsentOperator struct {
memoryConsumptionTracker *limiting.MemoryConsumptionTracker
}

var _ types.InstantVectorOperator = &AbsentOperator{}
var _ types.InstantVectorOperator = &Absent{}

// NewAbsentOperator creates a new AbsentOperator.
func NewAbsentOperator(inner types.InstantVectorOperator, innerExpr parser.Expr, timeRange types.QueryTimeRange, expressionPosition posrange.PositionRange, memoryConsumptionTracker *limiting.MemoryConsumptionTracker) *AbsentOperator {
return &AbsentOperator{
// NewAbsent creates a new Absent.
func NewAbsent(inner types.InstantVectorOperator, innerExpr parser.Expr, timeRange types.QueryTimeRange, expressionPosition posrange.PositionRange, memoryConsumptionTracker *limiting.MemoryConsumptionTracker) *Absent {
return &Absent{
timeRange: timeRange,
inner: inner,
innerExpr: innerExpr,
Expand All @@ -41,7 +41,7 @@ func NewAbsentOperator(inner types.InstantVectorOperator, innerExpr parser.Expr,
}
}

func (s *AbsentOperator) SeriesMetadata(ctx context.Context) ([]types.SeriesMetadata, error) {
func (s *Absent) SeriesMetadata(ctx context.Context) ([]types.SeriesMetadata, error) {
innerMetadata, err := s.inner.SeriesMetadata(ctx)
if err != nil {
return nil, err
Expand All @@ -62,7 +62,7 @@ func (s *AbsentOperator) SeriesMetadata(ctx context.Context) ([]types.SeriesMeta
return metadata, nil
}

func (s *AbsentOperator) NextSeries(ctx context.Context) (types.InstantVectorSeriesData, error) {
func (s *Absent) NextSeries(ctx context.Context) (types.InstantVectorSeriesData, error) {
output := types.InstantVectorSeriesData{}
var err error
output.Floats, err = types.FPointSlicePool.Get(s.absentCount, s.memoryConsumptionTracker)
Expand All @@ -83,11 +83,11 @@ func (s *AbsentOperator) NextSeries(ctx context.Context) (types.InstantVectorSer
return output, nil
}

func (s *AbsentOperator) ExpressionPosition() posrange.PositionRange {
func (s *Absent) ExpressionPosition() posrange.PositionRange {
return s.expressionPosition
}

func (s *AbsentOperator) Close() {
func (s *Absent) Close() {
s.inner.Close()
}

Expand Down

0 comments on commit 3b6cc48

Please sign in to comment.