Skip to content
Prev Previous commit
Next Next commit
Add comment to proto.Task
  • Loading branch information
salvacorts committed Nov 7, 2024
commit a3cb73f111cdf6c7d0cfa1d8f8035bc7396b0483
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
Loading