visibility_store.go ×12

Frontier kind: Code frontier

unlabeled · c_260a4738adec

50 tests · 4170 LOC · 187 files · introduces 0 tests · 54 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges54 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
738 ranges4170 lines · 187 files · Browse complete extent
All tests (intent)
50 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: 54 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

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

Open complete file

199 ) (*store.InternalListExecutionsResponse, error) {
200 if s.enableUnifiedQueryConverter() {
201 > return s.listWorkflowExecutions(ctx, request) visibility_store.go
202 > }
203 return s.listWorkflowExecutionsLegacy(ctx, request)
204 }
350 ctx context.Context,
351 request *manager.ListWorkflowExecutionsRequestV2,
352 > ) (*store.InternalListExecutionsResponse, error) { visibility_store.go
353 > return s.listExecutionsInternal(ctx, &listExecutionsRequestInternal{
354 > NamespaceID: request.NamespaceID,
355 > Namespace: request.Namespace,
356 > Query: request.Query,
357 > PageSize: request.PageSize,
358 > NextPageToken: request.NextPageToken,
359 > })
360 > }
361
362 func (s *VisibilityStore) listExecutionsInternal(
363 ctx context.Context,
364 request *listExecutionsRequestInternal,
365 > ) (*store.InternalListExecutionsResponse, error) { visibility_store.go
366 > sqlQC, err := NewSQLQueryConverter(s.GetName())
367 > if err != nil {
368 return nil, err
369 }
370
371 > saTypeMap, err := s.searchAttributesProvider.GetSearchAttributes(s.GetIndexName(), false) visibility_store.go
372 > if err != nil {
373 return nil, err
374 }
375
376 > saMapper, err := s.searchAttributesMapperProvider.GetMapper(request.Namespace) visibility_store.go
377 > if err != nil {
378 return nil, err
379 }
380
381 > queryParams, err := buildQueryParams( visibility_store.go
382 > request.NamespaceID,
383 > request.Namespace,
384 > request.Query,
385 > sqlQC,
386 > saTypeMap,
387 > saMapper,
388 > request.ChasmMapper,
389 > request.ArchetypeID,
390 > )
391 > if err != nil {
392 // Convert ConverterError to InvalidArgument and pass through all other errors (which should be
393 // only mapper errors).
399 }
400
401 > pageToken, err := sqlplugin.DeserializeVisibilityPageToken(request.NextPageToken) visibility_store.go
402 > if err != nil {
403 return nil, err
404 }
405
406 > sqlQueryString, queryArgs := sqlQC.BuildSelectStmt( visibility_store.go
407 > queryParams,
408 > request.PageSize,
409 > pageToken,
410 > )
411 > selectFilter := &sqlplugin.VisibilitySelectFilter{
412 > Query: sqlQueryString,
413 > QueryArgs: queryArgs,
414 > }
415 >
416 > rows, err := s.sqlStore.DB.SelectFromVisibility(ctx, *selectFilter)
417 > if err != nil {
418 return nil, convertSQLError("ListWorkflowExecutions operation failed.", err)
419 }
420 > if len(rows) == 0 { visibility_store.go
421 return &store.InternalListExecutionsResponse{}, nil
422 }
423
424 > var infos = make([]*store.InternalExecutionInfo, len(rows)) visibility_store.go
425 > for i, row := range rows {
426 > infos[i], err = s.rowToInfo(&row, request.ChasmMapper)
427 > if err != nil {
428 return nil, err
429 }
430 }
431
432 > var nextPageTokenResult []byte visibility_store.go
433 > if len(rows) > 0 && len(rows) == request.PageSize {
434 lastRow := rows[len(rows)-1]
435 closeTime := maxDatetime
446 }
447 }
448 > return &store.InternalListExecutionsResponse{ visibility_store.go
449 > Executions: infos,
450 > NextPageToken: nextPageTokenResult,
451 > }, nil
452 }
453