pri_task_reader.go ×3

Frontier kind: Code frontier

unlabeled · c_75d50ef1203d

88 tests · 3385 LOC · 150 files · introduces 0 tests · 26 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges26 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
542 ranges3385 lines · 150 files · Browse complete extent
All tests (intent)
88 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 26 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/pri_task_reader.go 20 introduced LOC · 3 ranges

Open complete file

272 // lock and call addNewTasks. We call addTaskToMatcher outside tr.lock since it may take other
273 // locks to redirect the task.
274 > func (tr *priTaskReader) recordNewTasksLocked(tasks []*persistencespb.AllocatedTaskInfo) { pri_task_reader.go
275 > // After we get to this point, we must eventually call task.finish or
276 > // task.finishForwarded, which will call tr.completeTask.
277 > for _, t := range tasks {
278 > tr.outstandingTasks.Put(t.TaskId, false)
279 > tr.loadedTasks++
280 > tr.backlogAge.record(t.Data.CreateTime, 1)
281 > }
282 }
283
285 // lock and call addNewTasks. We call addTaskToMatcher outside tr.lock since it may take other
286 // locks to redirect the task.
287 > func (tr *priTaskReader) addNewTasks(tasks []*persistencespb.AllocatedTaskInfo) { pri_task_reader.go
288 > for _, t := range tasks {
289 > task := newInternalTaskFromBacklog(t, tr.completeTask)
290 > tr.backlogMgr.setPriority(task)
291 > tr.addTaskToMatcher(task)
292 > }
293 }
294
295 > func (tr *priTaskReader) addTaskToMatcher(task *internalTask) { pri_task_reader.go
296 > task.resetMatcherState()
297 > err := tr.backlogMgr.addSpooledTask(task)
298 > if err == nil {
299 > return
300 > }
301
302 if drop, retry := tr.addErrorBehavior(err); drop {
go.temporal.io/server/service/matching/pri_backlog_manager.go 6 introduced LOC · 2 ranges

Open complete file

264 }
265
266 > func (c *priBacklogManagerImpl) addSpooledTask(task *internalTask) error { pri_backlog_manager.go
267 > return c.pqMgr.AddSpooledTask(task)
268 > }
269
270 func (c *priBacklogManagerImpl) BacklogCountHint() (total int64) {
437 }
438
439 > func (c *priBacklogManagerImpl) setPriority(task *internalTask) { pri_backlog_manager.go
440 > c.config.setDefaultPriority(task)
441 > if c.isDraining {
442 // draining goes before active backlog so we're guaranteed to finish migration
443 task.effectivePriority -= effectivePriorityFactor * maxPriorityLevels