visibility_store.go ×8

Frontier kind: Code frontier

unlabeled · c_f80468900f83

10 tests · 4049 LOC · 184 files · introduces 0 tests · 56 LOC · 4 files

Introduces — evidence that enters the hierarchy at this concept

Code
15 ranges56 lines · 4 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
699 ranges4049 lines · 184 files · Browse complete extent
All tests (intent)
10 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.

4 files ranked by introduced lines: 56 introduced LOC across 15 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

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

Open complete file

542 ctx context.Context,
543 request *manager.CountWorkflowExecutionsRequest,
544 > ) (*store.InternalCountExecutionsResponse, error) { visibility_store.go
545 > if s.enableUnifiedQueryConverter() {
546 > return s.countWorkflowExecutions(ctx, request)
547 > }
548 return s.countWorkflowExecutionsLegacy(ctx, request)
549 }
598 ctx context.Context,
599 request *manager.CountWorkflowExecutionsRequest,
600 > ) (*store.InternalCountExecutionsResponse, error) { visibility_store.go
601 > sqlQC, err := NewSQLQueryConverter(s.GetName())
602 > if err != nil {
603 return nil, err
604 }
605
606 > saTypeMap, err := s.searchAttributesProvider.GetSearchAttributes(s.GetIndexName(), false) visibility_store.go
607 > if err != nil {
608 return nil, err
609 }
610
611 > saMapper, err := s.searchAttributesMapperProvider.GetMapper(request.Namespace) visibility_store.go
612 > if err != nil {
613 return nil, err
614 }
615
616 > queryParams, err := buildQueryParams( visibility_store.go
617 > request.NamespaceID,
618 > request.Namespace,
619 > request.Query,
620 > sqlQC,
621 > saTypeMap,
622 > saMapper,
623 > nil,
624 > chasm.UnspecifiedArchetypeID,
625 > )
626 > if err != nil {
627 // Convert ConverterError to InvalidArgument and pass through all other errors (which should be
628 // only mapper errors).
634 }
635
636 > selectFilter := s.buildSelectFilterFromQueryParams(queryParams, sqlQC) visibility_store.go
637 >
638 > if len(selectFilter.GroupBy) > 0 {
639 return s.countGroupByExecutions(ctx, selectFilter, nil)
640 }
678 queryParams *query.QueryParams[sqlparser.Expr],
679 sqlQC *SQLQueryConverter,
680 > ) *sqlplugin.VisibilitySelectFilter { visibility_store.go
681 > queryString, queryArgs := sqlQC.BuildCountStmt(queryParams)
682 > groupBy := make([]string, 0, len(queryParams.GroupBy)+1)
683 > for _, field := range queryParams.GroupBy {
684 groupBy = append(groupBy, field.FieldName)
685 }
686
687 > return &sqlplugin.VisibilitySelectFilter{ visibility_store.go
688 > Query: queryString,
689 > QueryArgs: queryArgs,
690 > GroupBy: groupBy,
691 > }
692 }
693
go.temporal.io/server/common/persistence/visibility/visibility_manager_impl.go 11 introduced LOC · 4 ranges

Open complete file

320 ctx context.Context,
321 request *manager.CountWorkflowExecutionsRequest,
322 > ) (*manager.CountWorkflowExecutionsResponse, error) { visibility_manager_impl.go
323 > internalResp, err := p.store.CountWorkflowExecutions(ctx, request)
324 > if err != nil {
325 return nil, err
326 }
327
328 > return p.convertToCountWorkflowExecutionsResponse(internalResp) visibility_manager_impl.go
329 }
330
353 func (p *visibilityManagerImpl) convertToCountWorkflowExecutionsResponse(
354 internal *store.InternalCountExecutionsResponse,
355 > ) (*manager.CountWorkflowExecutionsResponse, error) { visibility_manager_impl.go
356 > response := &manager.CountWorkflowExecutionsResponse{
357 > Count: internal.Count,
358 > }
359 >
360 > if len(internal.Groups) > 0 {
361 response.Groups = make([]*workflowservice.CountWorkflowExecutionsResponse_AggregationGroup, 0, len(internal.Groups))
362 for _, group := range internal.Groups {
go.temporal.io/server/common/persistence/visibility/visiblity_manager_metrics.go 8 introduced LOC · 1 range

Open complete file

162 ctx context.Context,
163 request *manager.CountWorkflowExecutionsRequest,
164 > ) (*manager.CountWorkflowExecutionsResponse, error) { visiblity_manager_metrics.go
165 > handler, startTime := m.tagScope(metrics.VisibilityPersistenceCountWorkflowExecutionsScope)
166 > response, err := m.delegate.CountWorkflowExecutions(ctx, request)
167 > elapsed := time.Since(startTime)
168 > metrics.VisibilityPersistenceLatency.With(handler).Record(elapsed)
169 > metrics.ContextCounterAdd(ctx, metrics.TaskPersistenceLatency.Name(), elapsed.Nanoseconds())
170 > return response, m.updateErrorMetric(handler, err)
171 > }
172
173 func (m *visibilityManagerMetrics) CountChasmExecutions(
go.temporal.io/server/common/persistence/visibility/visibility_manager_rate_limited.go 3 introduced LOC · 2 ranges

Open complete file

131 ctx context.Context,
132 request *manager.CountWorkflowExecutionsRequest,
133 > ) (*manager.CountWorkflowExecutionsResponse, error) { visibility_manager_rate_limited.go
134 > if ok := allow(ctx, "CountWorkflowExecutions", m.readRateLimiter); !ok {
135 return nil, persistence.ErrPersistenceSystemLimitExceeded
136 }
137 > return m.delegate.CountWorkflowExecutions(ctx, request) visibility_manager_rate_limited.go
138 }
139