tree.go ×8

Frontier kind: Code frontier

unlabeled · c_facd53abb020

63 tests · 1311 LOC · 57 files · introduces 0 tests · 28 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges28 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
129 ranges1311 lines · 57 files · Browse complete extent
All tests (intent)
63 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: 28 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/hsm/tree.go 28 introduced LOC · 8 ranges

Open complete file

732 }
733
734 > root := newOpNode(Key{}) tree.go
735 > for _, op := range ol {
736 > node := root.getOrCreateNode(op.Path())
737 > if _, ok := op.(DeleteOperation); ok {
738 node.isDeleted = true
739 }
740 }
741
742 > return root.collect(ol) tree.go
743 }
744
745 // getOrCreateNode traverses/creates path and returns the final node.
746 > func (n *opNode) getOrCreateNode(path []Key) *opNode { tree.go
747 > current := n
748 > for _, key := range path {
749 next, exists := current.children[key]
750 if !exists {
754 current = next
755 }
756 > return current tree.go
757 }
758
773
774 // newOpNode creates a new operation tree node with the given key.
775 > func newOpNode(key Key) *opNode { tree.go
776 > return &opNode{
777 > key: key,
778 > children: make(map[Key]*opNode),
779 > }
780 > }
781
782 // collect returns an ordered subset of the input operation log based on the deletion status tracked in this operation
783 // tree. The original chronological order of operations is preserved. The status of each node in the path (not just the
784 // operation's target) determines whether the operation is included in the result.
785 > func (n *opNode) collect(oplog OperationLog) OperationLog { tree.go
786 > var result OperationLog
787 >
788 > for _, op := range oplog {
789 > path := op.Path()
790 > current := n
791 >
792 > var isAncestorDeleted bool
793 >
794 > // Traverse the path to the target node, checking deletion status
795 > for i, key := range path {
796 child, exists := current.children[key]
797 if !exists {
811 }
812
813 > if isAncestorDeleted { tree.go
814 continue
815 }
818 }
819
820 > return result tree.go
821 }