tree.go ×8

Frontier kind: Code frontier

unlabeled · c_752f447962b4

111 tests · 2183 LOC · 84 files · introduces 0 tests · 20 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges20 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
368 ranges2183 lines · 84 files · Browse complete extent
All tests (intent)
111 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: 20 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/chasm/tree.go 20 introduced LOC · 8 ranges

Open complete file

1292 func (n *Node) deserialize(
1293 valueT reflect.Type,
1294 > ) error { tree.go
1295 > if err := assertStructPointer(valueT); err != nil {
1296 return err
1297 }
1298
1299 > if n.valueState != valueStateNeedDeserialize && reflect.TypeOf(n.value) == valueT { tree.go
1300 return nil
1301 }
1302
1303 > switch n.serializedNode.GetMetadata().GetAttributes().(type) { tree.go
1304 > case *persistencespb.ChasmNodeMetadata_ComponentAttributes:
1305 > return n.deserializeComponentNode(valueT)
1306 case *persistencespb.ChasmNodeMetadata_DataAttributes:
1307 return n.deserializeDataNode(valueT)
1318 func (n *Node) deserializeComponentNode(
1319 valueT reflect.Type,
1320 > ) error { tree.go
1321 > // valueT is guaranteed to be a pointer to the struct because it was already validated by the assertStructPointer method.
1322 > valueV := reflect.New(valueT.Elem())
1323 >
1324 > for field := range fieldsOf(valueV) {
1325 > if field.err != nil {
1326 return field.err
1327 }
1328
1329 > switch field.kind { tree.go
1330 case fieldKindUnspecified:
1331 softassert.Fail(
1333 "field.kind can be unspecified only if err is not nil, and there is a check for it above",
1334 tag.String("node name", n.nodeName))
1335 > case fieldKindData: tree.go
1336 > value, err := unmarshalProto(n.serializedNode.GetData(), field.typ)
1337 > if err != nil {
1338 return err
1339 }
1340 > field.val.Set(value) tree.go
1341 case fieldKindSubField:
1342 if childNode, found := n.children[field.name]; found {
1379 }
1380
1381 > n.setValue(valueV.Interface()) tree.go
1382 > n.setValueState(valueStateSynced)
1383 > return nil
1384 }
1385