task_processor_manager.go ×7

Frontier kind: Code frontier

unlabeled · c_2700ca4e5428

2 tests · 3387 LOC · 152 files · introduces 0 tests · 56 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges56 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
464 ranges3387 lines · 152 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: 56 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/replication/task_processor_manager.go 35 introduced LOC · 7 ranges

Open complete file

250 }
251
252 > func (r *taskProcessorManagerImpl) cleanupReplicationTasks() error { task_processor_manager.go
253 > clusterMetadata := r.shard.GetClusterMetadata()
254 > allClusterInfo := clusterMetadata.GetAllClusterInfo()
255 > currentClusterName := clusterMetadata.GetCurrentClusterName()
256 >
257 > minAckedTaskID := r.shard.GetQueueExclusiveHighReadWatermark(tasks.CategoryReplication).TaskID - 1
258 > queueStates, ok := r.shard.GetQueueState(tasks.CategoryReplication)
259 > if !ok {
260 queueStates = &persistencespb.QueueState{
261 ExclusiveReaderHighWatermark: nil,
263 }
264 }
265 > for _, readerID := range targetReaderIDs( task_processor_manager.go
266 > currentClusterName,
267 > r.shard.GetShardID(),
268 > allClusterInfo,
269 > ) {
270 > readerState, ok := queueStates.ReaderStates[readerID]
271 > if !ok {
272 minAckedTaskID = min(minAckedTaskID, 0)
273 > } else { task_processor_manager.go
274 minAckedTaskID = min(minAckedTaskID, readerState.Scopes[0].Range.InclusiveMin.TaskId-1)
275 }
276 }
277
278 > if minAckedTaskID <= r.minTxAckedTaskID { task_processor_manager.go
279 return nil
280 }
342 currentShardID int32,
343 allClusterInfo map[string]cluster.ClusterInformation,
344 > ) []int64 { task_processor_manager.go
345 > currentShardCount := allClusterInfo[currentClusterName].ShardCount
346 > var readerIDs []int64
347 > for clusterName, clusterInfo := range allClusterInfo {
348 > if clusterName == currentClusterName || !clusterInfo.Enabled {
349 > continue
350 }
351
352 > targetClusterID := allClusterInfo[clusterName].InitialFailoverVersion task_processor_manager.go
353 > targetShardCount := allClusterInfo[clusterName].ShardCount
354 > for _, targetShardID := range common.MapShardID(
355 > currentShardCount,
356 > targetShardCount,
357 > currentShardID,
358 > ) {
359 > readerIDs = append(readerIDs, shard.ReplicationReaderIDFromClusterShardID(
360 > targetClusterID, targetShardID,
361 > ))
362 > }
363 }
364 > return readerIDs task_processor_manager.go
365 }
go.temporal.io/server/service/history/interfaces/shard_context_mock.go 16 introduced LOC · 4 ranges

Open complete file

423
424 // GetExecutionManager indicates an expected call of GetExecutionManager.
425 > func (mr *MockShardContextMockRecorder) GetExecutionManager() *gomock.Call { shard_context_mock.go
426 > mr.mock.ctrl.T.Helper()
427 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExecutionManager", reflect.TypeOf((*MockShardContext)(nil).GetExecutionManager))
428 > }
429
430 // GetFinalizer mocks base method.
451
452 // GetHistoryClient indicates an expected call of GetHistoryClient.
453 > func (mr *MockShardContextMockRecorder) GetHistoryClient() *gomock.Call { shard_context_mock.go
454 > mr.mock.ctrl.T.Helper()
455 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHistoryClient", reflect.TypeOf((*MockShardContext)(nil).GetHistoryClient))
456 > }
457
458 // GetHistoryTasks mocks base method.
536
537 // GetOwner indicates an expected call of GetOwner.
538 > func (mr *MockShardContextMockRecorder) GetOwner() *gomock.Call { shard_context_mock.go
539 > mr.mock.ctrl.T.Helper()
540 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOwner", reflect.TypeOf((*MockShardContext)(nil).GetOwner))
541 > }
542
543 // GetPayloadSerializer mocks base method.
550
551 // GetPayloadSerializer indicates an expected call of GetPayloadSerializer.
552 > func (mr *MockShardContextMockRecorder) GetPayloadSerializer() *gomock.Call { shard_context_mock.go
553 > mr.mock.ctrl.T.Helper()
554 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPayloadSerializer", reflect.TypeOf((*MockShardContext)(nil).GetPayloadSerializer))
555 > }
556
557 // GetQueueExclusiveHighReadWatermark mocks base method.
go.temporal.io/server/service/history/replication/task_fetcher_mock.go 5 introduced LOC · 1 range

Open complete file

30
31 // NewMockTaskFetcherFactory creates a new mock instance.
32 > func NewMockTaskFetcherFactory(ctrl *gomock.Controller) *MockTaskFetcherFactory { task_fetcher_mock.go
33 > mock := &MockTaskFetcherFactory{ctrl: ctrl}
34 > mock.recorder = &MockTaskFetcherFactoryMockRecorder{mock}
35 > return mock
36 > }
37
38 // EXPECT returns an object that allows the caller to indicate expected use.