dlq_v2_service.go ×12

Frontier kind: Code frontier

unlabeled · c_cef967b24c1d

2 tests · 3333 LOC · 142 files · introduces 0 tests · 42 LOC · 4 files

Introduces — evidence that enters the hierarchy at this concept

Code
16 ranges42 lines · 4 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
439 ranges3333 lines · 142 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.

4 files ranked by introduced lines: 42 introduced LOC across 16 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/tools/tdbg/dlq_v2_service.go 35 introduced LOC · 12 ranges

Open complete file

390 ) (tasks.Category, bool, error) {
391 if c.Command.Name == "list" {
392 > return tasks.Category{}, true, nil dlq_v2_service.go
393 > }
394 if categoryIDString == "" {
395 return tasks.Category{}, false, fmt.Errorf("--%s is required", FlagDLQType)
409 }
410
411 > func (ac *DLQV2Service) ListQueues(c *cli.Context) (err error) { dlq_v2_service.go
412 > ctx, cancel := newContext(c)
413 > defer cancel()
414 > if err != nil {
415 return err
416 }
417
418 > outputFile, err := getOutputFile(c.String(FlagOutputFilename), ac.writer) dlq_v2_service.go
419 > if err != nil {
420 return err
421 }
422
423 > defer func() { dlq_v2_service.go
424 > err = multierr.Append(err, outputFile.Close())
425 > }()
426
427 > adminClient := ac.clientFactory.AdminClient(c) dlq_v2_service.go
428 > pageSize := c.Int(FlagPageSize)
429 > iterator := collection.NewPagingIterator[*adminservice.ListQueuesResponse_QueueInfo](
430 > func(paginationToken []byte) ([]*adminservice.ListQueuesResponse_QueueInfo, []byte, error) {
431 > request := &adminservice.ListQueuesRequest{
432 > QueueType: int32(persistence.QueueTypeHistoryDLQ),
433 > PageSize: int32(pageSize),
434 > NextPageToken: paginationToken,
435 > }
436 > res, err := adminClient.ListQueues(ctx, request)
437 > if err != nil {
438 return nil, nil, fmt.Errorf("call to ListQueues failed: %w", err)
439 }
440 > return res.Queues, res.NextPageToken, nil dlq_v2_service.go
441 },
442 )
443
444 > var queues []adminservice.ListQueuesResponse_QueueInfo dlq_v2_service.go
445 > for iterator.HasNext() {
446 queue, err := iterator.Next()
447 if err != nil {
452
453 // Sort the list of queues in decreasing order of MessageCount.
454 > sort.Slice(queues, func(i, j int) bool { dlq_v2_service.go
455 return queues[i].MessageCount > queues[j].MessageCount
456 })
457
458 > items := make([]any, len(queues)) dlq_v2_service.go
459 > for i, queue := range queues {
460 items[i] = queue
461 }
462
463 > printJson := c.Bool(FlagPrintJSON) dlq_v2_service.go
464 > if printJson {
465 err = newEncoder(outputFile).Encode(items)
466 > } else { dlq_v2_service.go
467 > err = printTable(items, outputFile)
468 > }
469 > if err != nil {
470 return fmt.Errorf("failed to print dlq messages: %w", err)
471 }
472 > return nil dlq_v2_service.go
473 }
go.temporal.io/server/tools/tdbg/tdbg_commands.go 4 introduced LOC · 2 ranges

Open complete file

839 },
840 },
841 > Action: func(c *cli.Context) error { tdbg_commands.go
842 > ac, err := dlqServiceProvider.GetDLQService(c)
843 > if err != nil {
844 return err
845 }
846 > return ac.ListQueues(c) tdbg_commands.go
847 },
848 },
go.temporal.io/server/tools/tdbg/util.go 2 introduced LOC · 1 range

Open complete file

243 var exportRgx = regexp.MustCompile("^[A-Z]")
244
245 > func printTable(items []any, writer io.Writer) error { util.go
246 > if len(items) == 0 {
247 return nil
248 }
go.temporal.io/server/tools/tdbg/dlq_service.go 1 introduced LOC · 1 range

Open complete file

126 )
127 }
128 > targetCluster = cluster.ClusterName dlq_service.go
129 }
130 return targetCluster, nil, nil