execution_tasks.go ×5

Frontier kind: Code frontier

unlabeled · c_d48cc0cb22e7

12 tests · 3756 LOC · 165 files · introduces 0 tests · 50 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges50 lines · 2 files
Tests
0 tests

Contains — complete concept membership

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

go.temporal.io/server/common/persistence/sql/execution_tasks.go 35 introduced LOC · 5 ranges

Open complete file

91 case tasks.CategoryIDVisibility:
92 return m.getVisibilityTasks(ctx, request)
93 > case tasks.CategoryIDReplication: execution_tasks.go
94 > return m.getReplicationTasks(ctx, request)
95 }
96
452 ctx context.Context,
453 request *p.GetHistoryTasksRequest,
454 > ) (*p.InternalGetHistoryTasksResponse, error) { execution_tasks.go
455 > inclusiveMinTaskID, exclusiveMaxTaskID, err := getImmediateTaskReadRange(request)
456 > if err != nil {
457 return nil, err
458 }
459
460 > rows, err := m.DB.RangeSelectFromReplicationTasks(ctx, sqlplugin.ReplicationTasksRangeFilter{ execution_tasks.go
461 > ShardID: request.ShardID,
462 > InclusiveMinTaskID: inclusiveMinTaskID,
463 > ExclusiveMaxTaskID: exclusiveMaxTaskID,
464 > PageSize: request.BatchSize,
465 > })
466 >
467 > switch err {
468 > case nil:
469 > return m.populateGetReplicationTasksResponse(rows, request.ExclusiveMaxTaskKey.TaskID, request.BatchSize)
470 case sql.ErrNoRows:
471 return &p.InternalGetHistoryTasksResponse{}, nil
504 exclusiveMaxTaskID int64,
505 batchSize int,
506 > ) (*p.InternalGetHistoryTasksResponse, error) { execution_tasks.go
507 > if len(rows) == 0 {
508 return &p.InternalGetHistoryTasksResponse{}, nil
509 }
510
511 > var replicationTasks = make([]p.InternalHistoryTask, len(rows)) execution_tasks.go
512 > for i, row := range rows {
513 > replicationTasks[i] = p.InternalHistoryTask{
514 > Key: tasks.NewImmediateKey(row.TaskID),
515 > Blob: p.NewDataBlob(row.Data, row.DataEncoding),
516 > }
517 > }
518 > var nextPageToken []byte
519 > if len(rows) == batchSize {
520 > nextPageToken = getImmediateTaskNextPageToken(
521 > rows[len(rows)-1].TaskID,
522 > exclusiveMaxTaskID,
523 > )
524 > }
525 > return &p.InternalGetHistoryTasksResponse{
526 > Tasks: replicationTasks,
527 > NextPageToken: nextPageToken,
528 > }, nil
529 }
530
go.temporal.io/server/common/persistence/sql/execution_util.go 15 introduced LOC · 5 ranges

Open complete file

875 }
876
877 > replicationTasksRows := make([]sqlplugin.ReplicationTasksRow, 0, len(replicationTasks)) execution_util.go
878 > for _, task := range replicationTasks {
879 > replicationTasksRows = append(replicationTasksRows, sqlplugin.ReplicationTasksRow{
880 > ShardID: shardID,
881 > TaskID: task.Key.TaskID,
882 > Data: task.Blob.Data,
883 > DataEncoding: task.Blob.EncodingType.String(),
884 > })
885 > }
886
887 > result, err := tx.InsertIntoReplicationTasks(ctx, replicationTasksRows) execution_util.go
888 > if err != nil {
889 return serviceerror.NewUnavailablef("createReplicationTasks failed. Error: %v", err)
890 }
891
892 > rowsAffected, err := result.RowsAffected() execution_util.go
893 > if err != nil {
894 return serviceerror.NewUnavailablef("createReplicationTasks failed. Could not verify number of rows inserted. Error: %v", err)
895 }
896
897 > if int(rowsAffected) != len(replicationTasks) { execution_util.go
898 return serviceerror.NewUnavailablef("createReplicationTasks failed. Inserted %v instead of %v rows into transfer_tasks. Error: %v", rowsAffected, len(replicationTasks), err)
899 }
900 > return nil execution_util.go
901 }
902