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

Method PendingBlockKey

modules/backendscheduler/work/job.go:178–191  ·  view source on GitHub ↗

PendingBlockKey returns the blocks-pending index key for this job, or empty string if this job type does not claim a block. The key is used by Work to maintain the pendingBlocks index for fast IsBlockBusy lookups (O(1) pending check). Adding a new job type that needs block-pending tracking only requ

()

Source from the content-addressed store, hash-verified

176// check). Adding a new job type that needs block-pending tracking only requires
177// a new branch here; work.go stays type-agnostic.
178func (j *Job) PendingBlockKey() string {
179 j.mtx.Lock()
180 defer j.mtx.Unlock()
181
182 switch j.Type {
183 case tempopb.JobType_JOB_TYPE_REDACTION:
184 if j.JobDetail.Redaction == nil {
185 return ""
186 }
187 return j.JobDetail.Tenant + "\x00" + j.JobDetail.Redaction.BlockId
188 default:
189 return ""
190 }
191}

Callers 4

UnmarshalMethod · 0.80
rebuildPendingIndexesMethod · 0.80
AddPendingJobsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected