visibility_store.go ×10

Frontier kind: Code frontier

unlabeled · c_009c9532a942

4 tests · 2274 LOC · 95 files · introduces 0 tests · 38 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges38 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
382 ranges2274 lines · 95 files · Browse complete extent
All tests (intent)
4 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: 38 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/visibility/store/elasticsearch/visibility_store.go 38 introduced LOC · 10 ranges

Open complete file

313 esDoc map[string]any,
314 visibilityTaskKey string,
315 > ) error { visibility_store.go
316 > bulkIndexRequest := &client.BulkableRequest{
317 > Index: s.index,
318 > ID: GetDocID(request.WorkflowID, request.RunID),
319 > Version: request.TaskID,
320 > RequestType: client.BulkableRequestTypeIndex,
321 > Doc: esDoc,
322 > }
323 >
324 > return s.AddBulkRequestAndWait(ctx, bulkIndexRequest, visibilityTaskKey)
325 > }
326
327 func (s *VisibilityStore) AddBulkRequestAndWait(
924 request *store.InternalVisibilityRequestBase,
925 visibilityTaskKey string,
926 > ) (map[string]any, error) { visibility_store.go
927 > doc := map[string]any{
928 > sadefs.VisibilityTaskKey: visibilityTaskKey,
929 > sadefs.NamespaceID: request.NamespaceID,
930 > sadefs.WorkflowID: request.WorkflowID,
931 > sadefs.RunID: request.RunID,
932 > sadefs.WorkflowType: request.WorkflowTypeName,
933 > sadefs.StartTime: request.StartTime,
934 > sadefs.ExecutionTime: request.ExecutionTime,
935 > sadefs.ExecutionStatus: request.Status.String(),
936 > sadefs.TaskQueue: request.TaskQueue,
937 > sadefs.RootWorkflowID: request.RootWorkflowID,
938 > sadefs.RootRunID: request.RootRunID,
939 > }
940 >
941 > if request.ParentWorkflowID != nil {
942 doc[sadefs.ParentWorkflowID] = *request.ParentWorkflowID
943 }
944 > if request.ParentRunID != nil { visibility_store.go
945 doc[sadefs.ParentRunID] = *request.ParentRunID
946 }
947
948 > if len(request.Memo.GetData()) > 0 { visibility_store.go
949 doc[sadefs.Memo] = request.Memo.GetData()
950 doc[sadefs.MemoEncoding] = request.Memo.GetEncodingType().String()
951 }
952
953 > typeMap, err := s.searchAttributesProvider.GetSearchAttributes(s.index, false) visibility_store.go
954 > if err != nil {
955 metrics.ElasticsearchDocumentGenerateFailuresCount.With(s.metricsHandler).Record(1)
956 return nil, serviceerror.NewUnavailablef("unable to read search attribute types: %v", err)
957 }
958
959 > searchAttributes, err := searchattribute.Decode(request.SearchAttributes, &typeMap, true) visibility_store.go
960 > if err != nil {
961 metrics.ElasticsearchDocumentGenerateFailuresCount.With(s.metricsHandler).Record(1)
962 return nil, serviceerror.NewInternalf("unable to decode search attributes: %v", err)
963 }
964 > for name := range request.SearchAttributes.GetIndexedFields() { visibility_store.go
965 if _, ok := searchAttributes[name]; !ok {
966 s.logger.Warn("Skipping unknown search attribute while generating visibility record", tag.String("search-attribute", name))
969 // This is to prevent existing tasks to fail indefinitely.
970 // If it's only invalid values error, then silently continue without them.
971 > searchAttributes, err = s.ValidateCustomSearchAttributes(searchAttributes) visibility_store.go
972 > if err != nil {
973 if _, ok := err.(*serviceerror.InvalidArgument); !ok {
974 return nil, err
975 }
976 }
977 > for saName, saValue := range searchAttributes { visibility_store.go
978 if saValue == nil {
979 // If the search attribute value is `nil`, it means that it shouldn't be added to the document.