visibility_store.go ×7

Frontier kind: Code frontier

unlabeled · c_2ccd95dcac44

15 tests · 3582 LOC · 176 files · introduces 0 tests · 29 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges29 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
584 ranges3582 lines · 176 files · Browse complete extent
All tests (intent)
15 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.

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

go.temporal.io/server/common/persistence/visibility/store/sql/visibility_store.go 14 introduced LOC · 7 ranges

Open complete file

108 func (s *VisibilityStore) ValidateCustomSearchAttributes(
109 searchAttributes map[string]any,
110 > ) (map[string]any, error) { visibility_store.go
111 > return searchAttributes, nil
112 > }
113
114 func (s *VisibilityStore) RecordWorkflowExecutionStarted(
786 }
787
788 > saTypeMap, err := s.searchAttributesProvider.GetSearchAttributes(s.GetIndexName(), false) visibility_store.go
789 > if err != nil {
790 return nil, serviceerror.NewUnavailable(
791 fmt.Sprintf("Unable to read search attributes types: %v", err))
792 }
793
794 > var searchAttributes sqlplugin.VisibilitySearchAttributes visibility_store.go
795 > searchAttributes, err = searchattribute.Decode(request.SearchAttributes, &saTypeMap, false)
796 > if err != nil {
797 return nil, err
798 }
799 > if len(request.SearchAttributes.GetIndexedFields()) != len(searchAttributes) { visibility_store.go
800 for name := range request.SearchAttributes.GetIndexedFields() {
801 if _, ok := searchAttributes[name]; !ok {
806 // This is to prevent existing tasks to fail indefinitely.
807 // If it's only invalid values error, then silently continue without them.
808 > searchAttributes, err = s.ValidateCustomSearchAttributes(searchAttributes) visibility_store.go
809 > if err != nil {
810 if _, ok := err.(*serviceerror.InvalidArgument); !ok {
811 return nil, err
813 }
814
815 > for name, value := range searchAttributes { visibility_store.go
816 > if value == nil {
817 delete(searchAttributes, name)
818 continue
819 }
820 }
821 > return &searchAttributes, nil visibility_store.go
822 }
823
go.temporal.io/server/common/persistence/visibility/visibility_manager_impl.go 10 introduced LOC · 1 range

Open complete file

405 var searchAttrs *commonpb.SearchAttributes
406 if len(request.SearchAttributes.GetIndexedFields()) > 0 {
407 > // Remove any system search attribute from the map. visibility_manager_impl.go
408 > // This is necessary because the validation can supress errors when trying
409 > // to set a value on a system search attribute.
410 > searchAttrs = &commonpb.SearchAttributes{
411 > IndexedFields: make(map[string]*commonpb.Payload),
412 > }
413 > for key, value := range request.SearchAttributes.IndexedFields {
414 > if !sadefs.IsSystem(key) {
415 > searchAttrs.IndexedFields[key] = value
416 > }
417 }
418 }
go.temporal.io/server/common/persistence/sql/sqlplugin/visibility.go 5 introduced LOC · 3 ranges

Open complete file

130 }
131
132 > func (vsa VisibilitySearchAttributes) Value() (driver.Value, error) { visibility.go
133 > if vsa == nil {
134 return nil, nil
135 }
136 > bs, err := json.Marshal(vsa) visibility.go
137 > if err != nil {
138 return nil, err
139 }
140 > return string(bs), nil visibility.go
141 }
142