queue_store.go ×9

Frontier kind: Joint frontier

unlabeled · c_0f9629eded18

1 test · 5019 LOC · 202 files · introduces 1 test · 40 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges40 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
985 ranges5019 lines · 202 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.

1 file ranked by introduced lines: 40 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/cassandra/queue_store.go 40 introduced LOC · 9 ranges

Open complete file

76 ctx context.Context,
77 blob *commonpb.DataBlob,
78 > ) (int64, error) { queue_store.go
79 > // Use negative queue type as the dlq type
80 > lastMessageID, err := q.getLastMessageID(ctx, q.getDLQTypeFromQueueType())
81 > if err != nil {
82 return persistence.EmptyQueueMessageID, err
83 }
84
85 // Use negative queue type as the dlq type
86 > return q.tryEnqueue(ctx, q.getDLQTypeFromQueueType(), lastMessageID+1, blob) queue_store.go
87 }
88
159 pageSize int,
160 pageToken []byte,
161 > ) ([]*persistence.QueueMessage, []byte, error) { queue_store.go
162 > // Reading replication tasks need to be quorum level consistent, otherwise we could lose tasks
163 > // Use negative queue type as the dlq type
164 > query := q.session.Query(templateGetMessagesFromDLQQuery,
165 > q.getDLQTypeFromQueueType(),
166 > firstMessageID,
167 > lastMessageID,
168 > ).WithContext(ctx)
169 > iter := query.PageSize(pageSize).PageState(pageToken).Iter()
170 >
171 > var result []*persistence.QueueMessage
172 > message := make(map[string]any)
173 > for iter.MapScan(message) {
174 > queueMessage := convertQueueMessage(message)
175 > result = append(result, queueMessage)
176 > message = make(map[string]any)
177 > }
178
179 > var nextPageToken []byte queue_store.go
180 > if len(iter.PageState()) > 0 {
181 > nextPageToken = iter.PageState()
182 > }
183 > if err := iter.Close(); err != nil {
184 return nil, nil, gocql.ConvertError("ReadMessagesFromDLQ", err)
185 }
186
187 > return result, nextPageToken, nil queue_store.go
188 }
189
203 ctx context.Context,
204 messageID int64,
205 > ) error { queue_store.go
206 >
207 > // Use negative queue type as the dlq type
208 > query := q.session.Query(templateDeleteMessageQuery, q.getDLQTypeFromQueueType(), messageID).WithContext(ctx)
209 > if err := query.Exec(); err != nil {
210 return gocql.ConvertError("DeleteMessageFromDLQ", err)
211 }
212
213 > return nil queue_store.go
214 }
215
218 firstMessageID int64,
219 lastMessageID int64,
220 > ) error { queue_store.go
221 >
222 > // Use negative queue type as the dlq type
223 > query := q.session.Query(templateDeleteMessagesQuery, q.getDLQTypeFromQueueType(), firstMessageID, lastMessageID).WithContext(ctx)
224 > if err := query.Exec(); err != nil {
225 return gocql.ConvertError("RangeDeleteMessagesFromDLQ", err)
226 }
227
228 > return nil queue_store.go
229 }
230