dlq_handler.go ×7

Frontier kind: Code frontier

unlabeled · c_f5266dce6ea5

2 tests · 4208 LOC · 185 files · introduces 0 tests · 67 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges67 lines · 3 files
Tests
0 tests

Contains — complete concept membership

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

go.temporal.io/server/service/history/replication/dlq_handler.go 43 introduced LOC · 7 ranges

Open complete file

220 pageSize int,
221 pageToken []byte,
222 > ) ([]*replicationspb.ReplicationTask, []*replicationspb.ReplicationTaskInfo, int64, []byte, error) { dlq_handler.go
223 >
224 > ackLevel := r.shard.GetReplicatorDLQAckLevel(sourceCluster)
225 > resp, err := r.shard.GetExecutionManager().GetReplicationTasksFromDLQ(ctx, &persistence.GetReplicationTasksFromDLQRequest{
226 > GetHistoryTasksRequest: persistence.GetHistoryTasksRequest{
227 > ShardID: r.shard.GetShardID(),
228 > TaskCategory: tasks.CategoryReplication,
229 > InclusiveMinTaskKey: tasks.NewImmediateKey(ackLevel + 1),
230 > ExclusiveMaxTaskKey: tasks.NewImmediateKey(lastMessageID + 1),
231 > BatchSize: pageSize,
232 > NextPageToken: pageToken,
233 > },
234 > SourceClusterName: sourceCluster,
235 > })
236 > if err != nil {
237 return nil, nil, ackLevel, nil, err
238 }
239 > pageToken = resp.NextPageToken dlq_handler.go
240 >
241 > remoteAdminClient, err := r.shard.GetRemoteAdminClient(sourceCluster)
242 > if err != nil {
243 return nil, nil, ackLevel, nil, err
244 }
245 > taskInfo := make([]*replicationspb.ReplicationTaskInfo, 0, len(resp.Tasks)) dlq_handler.go
246 > for _, task := range resp.Tasks {
247 > switch task := task.(type) {
248 case *tasks.SyncActivityTask:
249 taskInfo = append(taskInfo, &replicationspb.ReplicationTaskInfo{
258 ScheduledEventId: task.ScheduledEventID,
259 })
260 > case *tasks.HistoryReplicationTask: dlq_handler.go
261 > taskInfo = append(taskInfo, &replicationspb.ReplicationTaskInfo{
262 > NamespaceId: task.NamespaceID,
263 > WorkflowId: task.WorkflowID,
264 > RunId: task.RunID,
265 > TaskType: enumsspb.TASK_TYPE_REPLICATION_HISTORY,
266 > TaskId: task.TaskID,
267 > Version: task.Version,
268 > FirstEventId: task.FirstEventID,
269 > NextEventId: task.NextEventID,
270 > ScheduledEventId: 0,
271 > })
272 case *tasks.SyncWorkflowStateTask:
273 taskInfo = append(taskInfo, &replicationspb.ReplicationTaskInfo{
295 }
296
297 > if len(taskInfo) == 0 { dlq_handler.go
298 return nil, nil, ackLevel, pageToken, nil
299 }
300
301 > dlqResponse, err := remoteAdminClient.GetDLQReplicationMessages( dlq_handler.go
302 > ctx,
303 > &adminservice.GetDLQReplicationMessagesRequest{
304 > TaskInfos: taskInfo,
305 > },
306 > )
307 > if err != nil {
308 return nil, nil, ackLevel, nil, err
309 }
310
311 > return dlqResponse.ReplicationTasks, taskInfo, ackLevel, pageToken, nil dlq_handler.go
312 }
313
go.temporal.io/server/api/adminservicemock/v1/service_grpc.pb.mock.go 13 introduced LOC · 3 ranges

Open complete file

345
346 // GetDLQReplicationMessages mocks base method.
347 > func (m *MockAdminServiceClient) GetDLQReplicationMessages(ctx context.Context, in *adminservice.GetDLQReplicationMessagesRequest, opts ...grpc.CallOption) (*adminservice.GetDLQReplicationMessagesResponse, error) { service_grpc.pb.mock.go
348 > m.ctrl.T.Helper()
349 > varargs := []any{ctx, in}
350 > for _, a := range opts {
351 varargs = append(varargs, a)
352 }
353 > ret := m.ctrl.Call(m, "GetDLQReplicationMessages", varargs...) service_grpc.pb.mock.go
354 > ret0, _ := ret[0].(*adminservice.GetDLQReplicationMessagesResponse)
355 > ret1, _ := ret[1].(error)
356 > return ret0, ret1
357 }
358
359 // GetDLQReplicationMessages indicates an expected call of GetDLQReplicationMessages.
360 > func (mr *MockAdminServiceClientMockRecorder) GetDLQReplicationMessages(ctx, in any, opts ...any) *gomock.Call { service_grpc.pb.mock.go
361 > mr.mock.ctrl.T.Helper()
362 > varargs := append([]any{ctx, in}, opts...)
363 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDLQReplicationMessages", reflect.TypeOf((*MockAdminServiceClient)(nil).GetDLQReplicationMessages), varargs...)
364 > }
365
366 // GetDLQTasks mocks base method.
go.temporal.io/server/common/persistence/data_interfaces_mock.go 11 introduced LOC · 2 ranges

Open complete file

416
417 // GetReplicationTasksFromDLQ mocks base method.
418 > func (m *MockExecutionManager) GetReplicationTasksFromDLQ(ctx context.Context, request *GetReplicationTasksFromDLQRequest) (*GetHistoryTasksResponse, error) { data_interfaces_mock.go
419 > m.ctrl.T.Helper()
420 > ret := m.ctrl.Call(m, "GetReplicationTasksFromDLQ", ctx, request)
421 > ret0, _ := ret[0].(*GetHistoryTasksResponse)
422 > ret1, _ := ret[1].(error)
423 > return ret0, ret1
424 > }
425
426 // GetReplicationTasksFromDLQ indicates an expected call of GetReplicationTasksFromDLQ.
427 > func (mr *MockExecutionManagerMockRecorder) GetReplicationTasksFromDLQ(ctx, request any) *gomock.Call { data_interfaces_mock.go
428 > mr.mock.ctrl.T.Helper()
429 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReplicationTasksFromDLQ", reflect.TypeOf((*MockExecutionManager)(nil).GetReplicationTasksFromDLQ), ctx, request)
430 > }
431
432 // GetWorkflowExecution mocks base method.