stream_receiver.go ×6

Frontier kind: Code frontier

unlabeled · c_bf40426f7a52

2 tests · 3769 LOC · 154 files · introduces 0 tests · 50 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges50 lines · 3 files
Tests
0 tests

Contains — complete concept membership

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

go.temporal.io/server/service/history/replication/executable_task_converter.go 22 introduced LOC · 4 ranges

Open complete file

41 tasks := make([]TrackableExecutableTask, len(replicationTasks))
42 for index, replicationTask := range replicationTasks {
43 > metrics.ReplicationTasksRecv.With(e.processToolBox.MetricsHandler).Record( executable_task_converter.go
44 > int64(1),
45 > metrics.FromClusterIDTag(serverShardKey.ClusterID),
46 > metrics.ToClusterIDTag(clientShardKey.ClusterID),
47 > metrics.OperationTag(TaskOperationTag(replicationTask)),
48 > )
49 > tasks[index] = e.convertOne(sourceClusterName, serverShardKey, replicationTask)
50 > }
51 return tasks
52 }
56 sourceShardKey ClusterShardKey,
57 replicationTask *replicationspb.ReplicationTask,
58 > ) TrackableExecutableTask { executable_task_converter.go
59 > var taskCreationTime time.Time
60 > if replicationTask.VisibilityTime != nil {
61 > taskCreationTime = replicationTask.VisibilityTime.AsTime()
62 > } else {
63 taskCreationTime = time.Now().UTC()
64 }
65
66 > switch replicationTask.GetTaskType() { executable_task_converter.go
67 case enumsspb.REPLICATION_TASK_TYPE_SYNC_SHARD_STATUS_TASK: // TODO to be deprecated
68 return NewExecutableNoopTask(
157 replicationTask,
158 )
160 > e.processToolBox.Logger.Error(fmt.Sprintf("unknown replication task: %v", replicationTask))
161 > return NewExecutableUnknownTask(
162 > e.processToolBox,
163 > replicationTask.SourceTaskId,
164 > taskCreationTime,
165 > replicationTask,
166 > )
167 }
168 }
go.temporal.io/server/service/history/replication/executable_task_tracker_mock.go 14 introduced LOC · 2 ranges

Open complete file

323
324 // TrackTasks mocks base method.
325 > func (m *MockExecutableTaskTracker) TrackTasks(exclusiveHighWatermarkInfo WatermarkInfo, arg1 ...TrackableExecutableTask) []TrackableExecutableTask { executable_task_tracker_mock.go
326 > m.ctrl.T.Helper()
327 > varargs := []any{exclusiveHighWatermarkInfo}
328 > for _, a := range arg1 {
329 > varargs = append(varargs, a)
330 > }
331 > ret := m.ctrl.Call(m, "TrackTasks", varargs...)
332 > ret0, _ := ret[0].([]TrackableExecutableTask)
333 > return ret0
334 }
335
336 // TrackTasks indicates an expected call of TrackTasks.
337 > func (mr *MockExecutableTaskTrackerMockRecorder) TrackTasks(exclusiveHighWatermarkInfo any, arg1 ...any) *gomock.Call { executable_task_tracker_mock.go
338 > mr.mock.ctrl.T.Helper()
339 > varargs := append([]any{exclusiveHighWatermarkInfo}, arg1...)
340 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TrackTasks", reflect.TypeOf((*MockExecutableTaskTracker)(nil).TrackTasks), varargs...)
341 > }
go.temporal.io/server/service/history/replication/stream_receiver.go 14 introduced LOC · 6 ranges

Open complete file

376 Timestamp: exclusiveHighWatermarkTime,
377 }, convertedTasks...) {
378 > schedulerPriority, err := r.getTaskSchedulerPriority(priority, task) stream_receiver.go
379 > if err != nil {
380 return err
381 }
382 > scheduler, err := r.getTaskScheduler(schedulerPriority) stream_receiver.go
383 > if err != nil {
384 return err
385 }
386
387 // Tests use this hook to pause replication tasks before they are applied.
388 > if hook, ok := testhooks.Get(r.TestHooks, testhooks.HistoryReplicationTaskInterceptor, testhooks.GlobalScope); ok { stream_receiver.go
389 originalTask := task
390 task = executeInterceptedTask{
396 }
397
398 > start := time.Now() stream_receiver.go
399 > scheduler.Submit(task)
400 > end := time.Now()
401 > if end.Sub(start) > submissionThreshold {
402 r.recordSlowSubmission(schedulerPriority, end)
403 }
404 }
405 }
406 > return nil stream_receiver.go
407 }
408
451 }
452
453 > func (r *StreamReceiverImpl) getTaskScheduler(priority enumsspb.TaskPriority) (ctasks.Scheduler[TrackableExecutableTask], error) { stream_receiver.go
454 > switch priority {
455 > case enumsspb.TASK_PRIORITY_HIGH:
456 > return r.HighPriorityTaskScheduler, nil
457 case enumsspb.TASK_PRIORITY_LOW:
458 return r.LowPriorityTaskScheduler, nil