matching_engine.go ×4

Frontier kind: Code frontier

unlabeled · c_3573d67ec0f3

422 tests · 3617 LOC · 169 files · introduces 0 tests · 55 LOC · 5 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges55 lines · 5 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
608 ranges3617 lines · 169 files · Browse complete extent
All tests (intent)
422 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.

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

go.temporal.io/server/service/matching/matching_engine.go 29 introduced LOC · 4 ranges

Open complete file

3166 version PhysicalTaskQueueVersion,
3167 delta int,
3168 > ) { matching_engine.go
3169 > // calculating versioned to be one of: “unversioned” or "buildId” or “versionSet”
3170 > versioned := "unversioned"
3171 > if dep := version.Deployment(); dep != nil {
3172 versioned = "deployment"
3173 > } else if buildID := version.BuildId(); buildID != "" { matching_engine.go
3174 versioned = "buildId"
3175 > } else if versionSet := version.VersionSet(); versionSet != "" { matching_engine.go
3176 versioned = "versionSet"
3177 }
3178
3179 > physicalTaskQueueParameters := taskQueueCounterKey{ matching_engine.go
3180 > namespaceID: partition.NamespaceId(),
3181 > taskType: partition.TaskType(),
3182 > partitionType: partition.Kind(),
3183 > versioned: versioned,
3184 > }
3185 >
3186 > e.gaugeMetrics.lock.Lock()
3187 > e.gaugeMetrics.loadedPhysicalTaskQueueCount[physicalTaskQueueParameters] += delta
3188 > loadedPhysicalTaskQueueCounter := e.gaugeMetrics.loadedPhysicalTaskQueueCount[physicalTaskQueueParameters]
3189 > e.gaugeMetrics.lock.Unlock()
3190 >
3191 > metrics.LoadedPhysicalTaskQueueGauge.With(
3192 > metrics.GetPerTaskQueuePartitionTypeScope(
3193 > e.metricsHandler,
3194 > ns.Name().String(),
3195 > partition,
3196 > // TODO: Track counters per TQ name so we can honor pm.config.BreakdownMetricsByTaskQueue(),
3197 > false,
3198 > )).Record(
3199 > float64(loadedPhysicalTaskQueueCounter),
3200 > metrics.VersionedTag(versioned),
3201 > )
3202 }
3203
go.temporal.io/server/service/matching/physical_task_queue_manager.go 17 introduced LOC · 3 ranges

Open complete file

293 }
294
295 > func (c *physicalTaskQueueManagerImpl) Start() { physical_task_queue_manager.go
296 > if !atomic.CompareAndSwapInt32(
297 > &c.status,
298 > common.DaemonStatusInitialized,
299 > common.DaemonStatusStarted,
300 > ) {
301 return
302 }
303 > c.liveness.Start() physical_task_queue_manager.go
304 > c.backlogMgr.Start()
305 > c.matcher.Start()
306 > c.logger.Info("Started physicalTaskQueueManager", tag.LifeCycleStarted, tag.Cause(c.config.loadCause.String()))
307 > c.metricsHandler.Counter(metrics.TaskQueueStartedCounter.Name()).Record(1)
308 > c.partitionMgr.engine.updatePhysicalTaskQueueGauge(c.partitionMgr.ns, c.partitionMgr.partition, c.queue.version, 1)
309 }
310
339
340 // getDrainBacklogMgr returns the draining backlog manager, or nil if none.
341 > func (c *physicalTaskQueueManagerImpl) getDrainBacklogMgr() backlogManager { physical_task_queue_manager.go
342 > c.drainBacklogMgrLock.Lock()
343 > defer c.drainBacklogMgrLock.Unlock()
344 > return c.drainBacklogMgr
345 > }
346
347 func (c *physicalTaskQueueManagerImpl) WaitUntilInitialized(ctx context.Context) error {
go.temporal.io/server/common/metrics/tags.go 3 introduced LOC · 1 range

Open complete file

403
404 // VersionedTag represents whether a loaded task queue manager represents a specific version set or build ID or not.
405 > func VersionedTag(versioned string) Tag { tags.go
406 > return Tag{Key: versionedTagName, Value: versioned}
407 > }
408
409 func ServiceErrorTypeTag(err error) Tag {
go.temporal.io/server/service/matching/config.go 3 introduced LOC · 1 range

Open complete file

444 return config.MetadataUpdateOnAppendInterval(ns.String(), taskQueueName, taskType)
445 },
446 > MaxTaskQueueIdleTime: func() time.Duration { config.go
447 > return config.MaxTaskQueueIdleTime(ns.String(), taskQueueName, taskType)
448 > },
449 MinTaskThrottlingBurstSize: func() int {
450 return config.MinTaskThrottlingBurstSize(ns.String(), taskQueueName, taskType)
go.temporal.io/server/service/matching/loadcause_string_gen.go 3 introduced LOC · 2 ranges

Open complete file

25 var _loadCause_index = [...]uint8{0, 11, 15, 20, 28, 36, 45, 49, 58, 68, 73}
26
27 > func (i loadCause) String() string { loadcause_string_gen.go
28 > if i < 0 || i >= loadCause(len(_loadCause_index)-1) {
29 return "loadCause(" + strconv.FormatInt(int64(i), 10) + ")"
30 }
31 > return _loadCause_name[_loadCause_index[i]:_loadCause_index[i+1]] loadcause_string_gen.go
32 }