history_v2_persistence.go ×6

Frontier kind: Code frontier

unlabeled · c_e2a5071af63f

14 tests · 4682 LOC · 183 files · introduces 0 tests · 38 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges38 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
865 ranges4682 lines · 183 files · Browse complete extent
All tests (intent)
14 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: 38 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/persistence-tests/history_v2_persistence.go 38 introduced LOC · 6 ranges

Open complete file

651 }
652
653 > func (s *HistoryV2PersistenceSuite) getBranchByKey(m *sync.Map, k int) []byte { history_v2_persistence.go
654 > v, ok := m.Load(k)
655 > s.Equal(true, ok)
656 > br := v.([]byte)
657 > return br
658 > }
659
660 func (s *HistoryV2PersistenceSuite) getIDByKey(m *sync.Map, k int) int64 {
718
719 for _, branch := range resp.Branches {
720 > if branch.BranchInfo.TreeId == treeID { history_v2_persistence.go
721 > branches = append(branches, branch.BranchInfo)
722 > }
723 }
724
733
734 // persistence helper
735 > func (s *HistoryV2PersistenceSuite) read(branch []byte, minID, maxID int64) []*historypb.HistoryEvent { history_v2_persistence.go
736 > res, err := s.readWithError(branch, minID, maxID)
737 > s.Nil(err)
738 > return res
739 > }
740
741 > func (s *HistoryV2PersistenceSuite) readWithError(branch []byte, minID, maxID int64) ([]*historypb.HistoryEvent, error) { history_v2_persistence.go
742 >
743 > // use small page size to enforce pagination
744 > randPageSize := 2
745 > res := make([]*historypb.HistoryEvent, 0)
746 > token := []byte{}
747 > for {
748 > resp, err := s.ExecutionManager.ReadHistoryBranch(s.ctx, &p.ReadHistoryBranchRequest{
749 > BranchToken: branch,
750 > MinEventID: minID,
751 > MaxEventID: maxID,
752 > PageSize: randPageSize,
753 > NextPageToken: token,
754 > ShardID: s.ShardInfo.GetShardId(),
755 > })
756 > if err != nil {
757 return nil, err
758 }
759 > if len(resp.HistoryEvents) > 0 { history_v2_persistence.go
760 > s.True(resp.Size > 0)
761 > }
762 > res = append(res, resp.HistoryEvents...)
763 > token = resp.NextPageToken
764 > if len(token) == 0 {
765 > break
766 }
767 }
768
769 > return res, nil history_v2_persistence.go
770 }
771