dlq_v2_service.go ×10

Frontier kind: Joint frontier

unlabeled · c_e071a63a648e

1 test · 3694 LOC · 154 files · introduces 1 test · 57 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
17 ranges57 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
548 ranges3694 lines · 154 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 57 introduced LOC across 17 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/tools/tdbg/dlq_v2_service.go 32 introduced LOC · 10 ranges

Open complete file

61 )
62
63 > func (p *TaskPayload) MarshalJSON() ([]byte, error) { dlq_v2_service.go
64 > var b bytes.Buffer
65 > err := p.taskBlobEncoder.Encode(&b, p.taskCategoryID, p.blob)
66 > if err != nil {
67 return nil, err
68 }
69 > return b.Bytes(), nil dlq_v2_service.go
70 }
71
72 > func (p *TaskPayload) UnmarshalJSON(b []byte) error { dlq_v2_service.go
73 > p.bytes = b
74 > return nil
75 > }
76
77 // Bytes returns the raw bytes of the deserialized TaskPayload. This will return nil if the payload has not been
78 // deserialized yet.
79 > func (p *TaskPayload) Bytes() []byte { dlq_v2_service.go
80 > return p.bytes
81 > }
82
83 const dlqV2DefaultMaxMessageCount = 100
176 return nil, nil, fmt.Errorf("call to GetDLQTasks from ReadMessages failed: %w", err)
177 }
178 > return res.DlqTasks, res.NextPageToken, nil dlq_v2_service.go
179 },
180 )
185 return fmt.Errorf("DLQ task iterator returned error: %w", err)
186 }
187 > if dlqTask.Metadata.MessageId > maxMessageID { dlq_v2_service.go
188 break
189 }
190 > blob := dlqTask.Payload.Blob dlq_v2_service.go
191 > if blob == nil {
192 return fmt.Errorf("DLQ task payload blob is nil: %+v", dlqTask)
193 }
194 > payload := &TaskPayload{ dlq_v2_service.go
195 > taskBlobEncoder: ac.taskBlobEncoder,
196 > blob: blob,
197 > taskCategoryID: ac.category.ID(),
198 > }
199 > message := DLQMessage{
200 > MessageID: dlqTask.Metadata.MessageId,
201 > ShardID: dlqTask.Payload.ShardId,
202 > Payload: payload,
203 > }
204 > err = newEncoder(outputFile).Encode(message)
205 > if err != nil {
206 return err
207 }
208 > remainingMessageCount-- dlq_v2_service.go
209 > _, err = outputFile.Write([]byte("\n"))
210 > if err != nil {
211 return fmt.Errorf("fail to print dlq messages: %s", err)
212 }
go.temporal.io/server/tools/tdbg/tdbgtest/output_parsing.go 25 introduced LOC · 7 ranges

Open complete file

20
21 // ParseDLQMessages parses a JSONL file containing serialized [tdbg.DLQMessage] objects.
22 > func ParseDLQMessages[T proto.Message](file io.Reader, newMessage func() T) ([]DLQMessage[T], error) { output_parsing.go
23 > var opts temporalproto.CustomJSONUnmarshalOptions
24 > decodeNext := func(decoder *json.Decoder) (DLQMessage[T], error) {
25 > var dlqMessage tdbg.DLQMessage
26 > err := decoder.Decode(&dlqMessage)
27 > if err != nil {
28 return DLQMessage[T]{}, err
29 }
30 > protoMessage := newMessage() output_parsing.go
31 > b := dlqMessage.Payload.Bytes()
32 > if err = opts.Unmarshal(b, protoMessage); err != nil {
33 return DLQMessage[T]{}, err
34 }
35 > return DLQMessage[T]{ output_parsing.go
36 > MessageID: dlqMessage.MessageID,
37 > ShardID: dlqMessage.ShardID,
38 > Payload: protoMessage,
39 > }, nil
40 }
41 > return ParseJSONL(file, decodeNext) output_parsing.go
42 }
43
44 // ParseJSONL parses a JSONL file. We separate this out from [ParseDLQMessages] so that we can reuse it for other JSONL
45 // files that don't contain [tdbg.DLQMessage] objects (i.e. when [tdbg.DLQV1Service] is used).
46 > func ParseJSONL[T any](file io.Reader, decodeNext func(decoder *json.Decoder) (T, error)) ([]T, error) { output_parsing.go
47 > decoder := json.NewDecoder(file)
48 > var (
49 > messages []T
50 > )
51 > for decoder.More() {
52 > message, err := decodeNext(decoder)
53 > if err != nil {
54 return nil, err
55 }
56 > messages = append(messages, message) output_parsing.go
57 }
58 > return messages, nil output_parsing.go
59 }