MCPcopy
hub / github.com/grafana/tempo / New

Function New

modules/backendscheduler/work/work.go:74–94  ·  view source on GitHub ↗
(cfg Config)

Source from the content-addressed store, hash-verified

72}
73
74func New(cfg Config) Interface {
75 sw := &Work{
76 cfg: cfg,
77 }
78
79 // Initialize all shards
80 for i := range ShardCount {
81 sw.Shards[i] = &Shard{
82 Jobs: make(map[string]*Job),
83 Pending: make(map[string]*Job),
84 }
85 }
86 sw.pendingBlocks = make(map[string]string)
87 sw.pendingByTenant = make(map[string]map[tempopb.JobType][]string)
88 sw.redactionInFlight = make(map[string]int)
89 sw.registeredJobs = make(map[string]*Job)
90 sw.runningBlocks = make(map[string]*Job)
91 sw.batches = newBatchStore()
92
93 return sw
94}
95
96// AddJob adds a job to the appropriate shard
97func (w *Work) AddJob(j *Job) error {

Calls 1

newBatchStoreFunction · 0.85