Skip to content

Commit

Permalink
Add comment to proto.Task
Browse files Browse the repository at this point in the history
  • Loading branch information
salvacorts committed Nov 7, 2024
1 parent 0d1e610 commit a3cb73f
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions pkg/bloombuild/protos/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type Gap struct {
Blocks []bloomshipper.BlockRef
}

// Task is a convenience struct equivalent to the protobuf ProtoTask message but with Loki types.
type Task struct {
ID string

Expand All @@ -29,24 +30,6 @@ type Task struct {
Gaps []Gap
}

func NewTask(
table config.DayTable,
tenant string,
bounds v1.FingerprintBounds,
tsdb tsdb.SingleTenantTSDBIdentifier,
gaps []Gap,
) *Task {
return &Task{
ID: fmt.Sprintf("%s-%s-%s-%d", table.Addr(), tenant, bounds.String(), len(gaps)),

Table: table,
Tenant: tenant,
OwnershipBounds: bounds,
TSDB: tsdb,
Gaps: gaps,
}
}

func FromProtoTask(task *ProtoTask) (*Task, error) {
if task == nil {
return nil, nil
Expand Down

0 comments on commit a3cb73f

Please sign in to comment.