slice.go ×5

Frontier kind: Code frontier

unlabeled · c_b29e2da9826f

8 tests · 2643 LOC · 135 files · introduces 0 tests · 32 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges32 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
402 ranges2643 lines · 135 files · Browse complete extent
All tests (intent)
8 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: 32 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/queues/slice.go 26 introduced LOC · 5 ranges

Open complete file

303 }
304
305 > func (s *SliceImpl) ShrinkScope() int { slice.go
306 > s.stateSanityCheck()
307 >
308 > tasksCompleted := s.shrinkRange()
309 > s.shrinkPredicate()
310 >
311 > // shrinkRange shrinks the executableTracker, which may remove tracked pending executables. Set the
312 > // pending task count to reflect that.
313 > s.monitor.SetSlicePendingTaskCount(s, len(s.pendingExecutables))
314 >
315 > return tasksCompleted
316 > }
317
318 > func (s *SliceImpl) shrinkRange() int { slice.go
319 > minPendingTaskKey, tasksCompleted := s.shrink()
320 >
321 > minIteratorKey := tasks.MaximumKey
322 > if len(s.iterators) != 0 {
323 minIteratorKey = s.iterators[0].Range().InclusiveMin
324 }
325
326 // pick min key for tasks in memory and in persistence
327 > newRangeMin := tasks.MinKey(minPendingTaskKey, minIteratorKey) slice.go
328 >
329 > // no pending task in memory and in persistence
330 > if newRangeMin == tasks.MaximumKey {
331 newRangeMin = s.scope.Range.ExclusiveMax
332 }
333
334 > s.scope.Range.InclusiveMin = newRangeMin slice.go
335 >
336 > return tasksCompleted
337 }
338
339 > func (s *SliceImpl) shrinkPredicate() { slice.go
340 > if len(s.iterators) != 0 {
341 // predicate can't be updated if there're still
342 // tasks in persistence, as we don't know if those
go.temporal.io/server/service/history/queues/tracker.go 6 introduced LOC · 3 ranges

Open complete file

83 }
84
85 > func (t *executableTracker) shrink() (tasks.Key, int) { tracker.go
86 > var tasksCompleted int
87 > minPendingTaskKey := tasks.MaximumKey
88 > for key, executable := range t.pendingExecutables {
89 if executable.State() == ctasks.TaskStateAcked {
90 t.pendingPerKey[t.grouper.Key(executable)]--
97 }
98
99 > for key, numPending := range t.pendingPerKey { tracker.go
100 if numPending == 0 {
101 delete(t.pendingPerKey, key)
103 }
104
105 > return minPendingTaskKey, tasksCompleted tracker.go
106 }
107