history_store.go ×10

Frontier kind: Code frontier

unlabeled · c_c1cf6ca12a16

5 tests · 3832 LOC · 173 files · introduces 0 tests · 52 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges52 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
672 ranges3832 lines · 173 files · Browse complete extent
All tests (intent)
5 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.

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

go.temporal.io/server/common/persistence/cassandra/history_store.go 52 introduced LOC · 10 ranges

Open complete file

269 ctx context.Context,
270 request *p.InternalDeleteHistoryBranchRequest,
271 > ) error { history_store.go
272 >
273 > batch := h.Session.NewBatch(gocql.LoggedBatch).WithContext(ctx)
274 > batch.Query(v2templateDeleteBranch, request.BranchInfo.TreeId, request.BranchInfo.BranchId)
275 >
276 > // delete each branch range
277 > for _, br := range request.BranchRanges {
278 > h.deleteBranchRangeNodes(batch, request.BranchInfo.TreeId, br.BranchId, br.BeginNodeId)
279 > }
280
281 > err := h.Session.ExecuteBatch(batch) history_store.go
282 > if err != nil {
283 return gocql.ConvertError("DeleteHistoryBranch", err)
284 }
285 > return nil history_store.go
286 }
287
291 branchID string,
292 beginNodeID int64,
293 > ) { history_store.go
294 >
295 > batch.Query(v2templateRangeDeleteHistoryNode,
296 > treeID,
297 > branchID,
298 > beginNodeID)
299 > }
300
301 func (h *HistoryStore) GetAllHistoryTreeBranches(
350 ctx context.Context,
351 request *p.InternalGetHistoryTreeContainingBranchRequest,
352 > ) (*p.InternalGetHistoryTreeContainingBranchResponse, error) { history_store.go
353 >
354 > branch, err := h.ParseHistoryBranchInfo(request.BranchToken)
355 > if err != nil {
356 return nil, err
357 }
358
359 > treeID, err := primitives.ValidateUUID(branch.TreeId) history_store.go
360 > if err != nil {
361 return nil, serviceerror.NewInternalf("ReadHistoryBranch. Gocql TreeId UUID cast failed. Error: %v", err)
362 }
363 > query := h.Session.Query(v2templateReadAllBranches, treeID).WithContext(ctx) history_store.go
364 >
365 > pageSize := 100
366 > var pagingToken []byte
367 > treeInfos := make([]*commonpb.DataBlob, 0, pageSize)
368 >
369 > var iter gocql.Iter
370 > for {
371 > iter = query.PageSize(pageSize).PageState(pagingToken).Iter()
372 > pagingToken = iter.PageState()
373 >
374 > branchUUID := ""
375 > var data []byte
376 > var encoding string
377 > for iter.Scan(&branchUUID, &data, &encoding) {
378 > treeInfos = append(treeInfos, p.NewDataBlob(data, encoding))
379 >
380 > branchUUID = ""
381 > data = []byte{}
382 > encoding = ""
383 > }
384
385 > if err := iter.Close(); err != nil { history_store.go
386 return nil, gocql.ConvertError("GetHistoryTree", err)
387 }
388
389 > if len(pagingToken) == 0 { history_store.go
390 > break
391 }
392 }
393
394 > return &p.InternalGetHistoryTreeContainingBranchResponse{ history_store.go
395 > TreeInfos: treeInfos,
396 > }, nil
397 }
398