visibility_queue_task_executor.go ×16

Frontier kind: Code frontier

unlabeled · c_29d747038408

2 tests · 6853 LOC · 246 files · introduces 0 tests · 60 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
16 ranges60 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1358 ranges6853 lines · 246 files · Browse complete extent
All tests (intent)
2 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.

1 file ranked by introduced lines: 60 introduced LOC across 16 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/visibility_queue_task_executor.go 60 introduced LOC · 16 ranges

Open complete file

378 }
379
380 > tree := mutableState.ChasmTree() visibility_queue_task_executor.go
381 > if tree == nil {
382 return errNoChasmTree
383 }
384 > chasmNode, ok := tree.(*chasm.Node) visibility_queue_task_executor.go
385 > if !ok {
386 return serviceerror.NewInternalf(
387 "CHASM tree implementation not properly wired up, encountered type: %T, expected type: %T",
391 }
392
393 > visTaskContext := chasm.NewContext(ctx, chasmNode) visibility_queue_task_executor.go
394 > component, err := tree.ComponentByPath(visTaskContext, task.Info.Path)
395 > if err != nil {
396 return err
397 }
398 > visComponent, ok := component.(*chasm.Visibility) visibility_queue_task_executor.go
399 > if !ok {
400 return serviceerror.NewInternalf("expected visibility component, but got %T", visComponent)
401 }
402
403 > namespaceEntry, err := t.shardContext.GetNamespaceRegistry(). visibility_queue_task_executor.go
404 > GetNamespaceByID(namespace.ID(task.GetNamespaceID()))
405 > if err != nil {
406 return err
407 }
408
409 > customSaMapperProvider := t.shardContext.GetSearchAttributesMapperProvider() visibility_queue_task_executor.go
410 > customSaMapper, err := customSaMapperProvider.GetMapper(namespaceEntry.Name())
411 > if err != nil {
412 return err
413 }
414
415 > searchAttributes := make(map[string]*commonpb.Payload) visibility_queue_task_executor.go
416 >
417 > aliasedCustomSearchAttributes := visComponent.CustomSearchAttributes(visTaskContext)
418 > for alias, value := range aliasedCustomSearchAttributes {
419 fieldName, err := customSaMapper.GetFieldName(alias, namespaceEntry.Name().String())
420 if err != nil {
434 // chasmMapper holds the archetype's search attribute registration, including which system
435 // search attributes it overrides.
436 > var chasmMapper *chasm.VisibilitySearchAttributesMapper visibility_queue_task_executor.go
437 > if rc, ok := t.shardContext.ChasmRegistry().ComponentByID(tree.ArchetypeID()); ok {
438 > chasmMapper = rc.SearchAttributesMapper()
439 > }
440
441 // systemOverrides holds component-provided values for registered system search attribute overrides.
442 > systemOverrides := make(map[string]chasm.VisibilityValue) visibility_queue_task_executor.go
443 > if chasmSAProvider, ok := rootComponent.(chasm.VisibilitySearchAttributesProvider); ok {
444 > for _, chasmSA := range chasmSAProvider.SearchAttributes(visTaskContext) {
445 > if chasmMapper.IsSystemOverride(chasmSA.Field) {
446 systemOverrides[chasmSA.Field] = chasmSA.Value
447 continue
448 }
449 > searchAttributes[chasmSA.Field] = chasmSA.Value.MustEncode() visibility_queue_task_executor.go
450 }
451 }
452
453 > combinedMemo := make(map[string]*commonpb.Payload, 2) visibility_queue_task_executor.go
454 > userMemoMap := visComponent.CustomMemo(visTaskContext)
455 > if len(userMemoMap) > 0 {
456 userMemoProto := &commonpb.Memo{Fields: userMemoMap}
457 userMemoPayload, err := payload.Encode(userMemoProto)
461 combinedMemo[chasm.UserMemoKey] = userMemoPayload
462 }
463 > if memoProvider, ok := rootComponent.(chasm.VisibilityMemoProvider); ok { visibility_queue_task_executor.go
464 > chasmMemo := memoProvider.Memo(visTaskContext)
465 > if chasmMemo != nil {
466 > chasmMemoPayload, err := payload.Encode(chasmMemo)
467 > if err != nil {
468 return err
469 }
470 > combinedMemo[chasm.ChasmMemoKey] = chasmMemoPayload visibility_queue_task_executor.go
471 }
472 }
473
474 > requestBase := t.getVisibilityRequestBase( visibility_queue_task_executor.go
475 > task,
476 > namespaceEntry,
477 > mutableState,
478 > combinedMemo,
479 > searchAttributes,
480 > )
481 >
482 > // We reuse the TemporalNamespaceDivision column to store the string representation of ArchetypeID.
483 > searchattribute.AddSearchAttributes(
484 > &requestBase.SearchAttributes,
485 > chasm.SearchAttributeTemporalNamespaceDivision.Value(strconv.FormatUint(uint64(tree.ArchetypeID()), 10)),
486 > )
487 >
488 > // Apply overrides for system search attributes (e.g. TaskQueue, ExecutionTime) that are not
489 > // CHASM system search attributes. The request base initializes these system columns from
490 > // mutable state; a component may override them with its own value emitted from SearchAttributes().
491 > applyChasmOverriddenSystemFields(requestBase, systemOverrides)
492 >
493 > if mutableState.IsWorkflowExecutionRunning() {
494 release(nil)
495 return t.visibilityMgr.UpsertWorkflowExecution(