visibility_store.go ×10

Frontier kind: Code frontier

unlabeled · c_fd470f754533

56 tests · 3610 LOC · 175 files · introduces 0 tests · 54 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
16 ranges54 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
587 ranges3610 lines · 175 files · Browse complete extent
All tests (intent)
56 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: 54 introduced LOC across 16 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/visibility/visibility_manager_impl.go 31 introduced LOC · 6 ranges

Open complete file

477 }
478
479 > customSAs, _ := splitSearchAttributes(internalExecution.SearchAttributes) visibility_manager_impl.go
480 > aliasedCustomSAs, err := searchattribute.AliasFields(p.searchAttributesMapperProvider, customSAs, namespaceName.String())
481 > if err != nil {
482 return nil, err
483 }
484 > userMemo, _, err := splitUserAndChasmMemo(internalExecution) visibility_manager_impl.go
485 > if err != nil {
486 return nil, err
487 }
488
489 > executionInfo := &workflowpb.WorkflowExecutionInfo{ visibility_manager_impl.go
490 > Execution: &commonpb.WorkflowExecution{
491 > WorkflowId: internalExecution.WorkflowID,
492 > RunId: internalExecution.RunID,
493 > },
494 > Type: &commonpb.WorkflowType{
495 > Name: internalExecution.TypeName,
496 > },
497 > StartTime: timestamppb.New(internalExecution.StartTime),
498 > ExecutionTime: timestamppb.New(internalExecution.ExecutionTime),
499 > Memo: userMemo,
500 > SearchAttributes: aliasedCustomSAs,
501 > TaskQueue: internalExecution.TaskQueue,
502 > Status: internalExecution.Status,
503 > RootExecution: &commonpb.WorkflowExecution{
504 > WorkflowId: internalExecution.RootWorkflowID,
505 > RunId: internalExecution.RootRunID,
506 > },
507 > // TODO: poplulate FirstRunId once it has been added as a system search attribute.
508 > }
509 >
510 > if internalExecution.ParentWorkflowID != "" {
511 executionInfo.ParentExecution = &commonpb.WorkflowExecution{
512 WorkflowId: internalExecution.ParentWorkflowID,
517 // for close records. Running and paused workflows are still open executions and
518 // must not have a CloseTime; only truly closed workflows have one.
519 > if internalExecution.Status != enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING && visibility_manager_impl.go
520 > internalExecution.Status != enumspb.WORKFLOW_EXECUTION_STATUS_PAUSED {
521 executionInfo.CloseTime = timestamppb.New(internalExecution.CloseTime)
522 executionInfo.ExecutionDuration = durationpb.New(internalExecution.ExecutionDuration)
530 // Remove this "if" block when ExecutionTime field has actual correct value (added 6/9/21).
531 // Affects only non-advanced visibility.
532 > if !executionInfo.ExecutionTime.AsTime().After(time.Unix(0, 0)) { visibility_manager_impl.go
533 executionInfo.ExecutionTime = timestamppb.New(internalExecution.StartTime)
534 }
535
536 > return executionInfo, nil visibility_manager_impl.go
537 }
538
go.temporal.io/server/common/persistence/visibility/store/sql/visibility_store.go 23 introduced LOC · 10 ranges

Open complete file

825 row *sqlplugin.VisibilityRow,
826 chasmMapper *chasm.VisibilitySearchAttributesMapper,
827 > ) (*store.InternalExecutionInfo, error) { visibility_store.go
828 > if row.ExecutionTime.UnixNano() == 0 {
829 row.ExecutionTime = row.StartTime
830 }
831 > info := &store.InternalExecutionInfo{ visibility_store.go
832 > WorkflowID: row.WorkflowID,
833 > RunID: row.RunID,
834 > TypeName: row.WorkflowTypeName,
835 > StartTime: row.StartTime,
836 > ExecutionTime: row.ExecutionTime,
837 > Status: enumspb.WorkflowExecutionStatus(row.Status),
838 > TaskQueue: row.TaskQueue,
839 > RootWorkflowID: row.RootWorkflowID,
840 > RootRunID: row.RootRunID,
841 > Memo: persistence.NewDataBlob(row.Memo, row.Encoding),
842 > }
843 > if row.SearchAttributes != nil && len(*row.SearchAttributes) > 0 {
844 // Encode all search attributes together (both CHASM and custom)
845 encodedSAs, err := s.encodeRowSearchAttributes(*row.SearchAttributes, chasmMapper)
849 info.SearchAttributes = encodedSAs
850 }
851 > if row.CloseTime != nil { visibility_store.go
852 info.CloseTime = *row.CloseTime
853 }
854 > if row.ExecutionDuration != nil { visibility_store.go
855 info.ExecutionDuration = time.Duration(*row.ExecutionDuration)
856 }
857 > if row.HistoryLength != nil { visibility_store.go
858 info.HistoryLength = *row.HistoryLength
859 }
860 > if row.HistorySizeBytes != nil { visibility_store.go
861 info.HistorySizeBytes = *row.HistorySizeBytes
862 }
863 > if row.StateTransitionCount != nil { visibility_store.go
864 info.StateTransitionCount = *row.StateTransitionCount
865 }
866 > if row.ParentWorkflowID != nil { visibility_store.go
867 info.ParentWorkflowID = *row.ParentWorkflowID
868 }
869 > if row.ParentRunID != nil { visibility_store.go
870 info.ParentRunID = *row.ParentRunID
871 }
872 > return info, nil visibility_store.go
873 }
874