mutable_state_store.go ×6

Frontier kind: Code frontier

unlabeled · c_85139d31925a

40 tests · 5193 LOC · 187 files · introduces 0 tests · 107 LOC · 6 files

Introduces — evidence that enters the hierarchy at this concept

Code
14 ranges107 lines · 6 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1008 ranges5193 lines · 187 files · Browse complete extent
All tests (intent)
40 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.

6 files ranked by introduced lines: 107 introduced LOC across 14 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/cassandra/mutable_state_store.go 70 introduced LOC · 6 ranges

Open complete file

512 }
513
514 > state, err := mutableStateFromRow(result) mutable_state_store.go
515 > if err != nil {
516 return nil, serviceerror.NewUnavailablef("GetWorkflowExecution operation failed. Error: %v", err)
517 }
518
519 > activityInfos := make(map[int64]*commonpb.DataBlob) mutable_state_store.go
520 > aMap := result["activity_map"].(map[int64][]byte)
521 > aMapEncoding := result["activity_map_encoding"].(string)
522 > for key, value := range aMap {
523 > activityInfos[key] = p.NewDataBlob(value, aMapEncoding)
524 > }
525 > state.ActivityInfos = activityInfos
526 >
527 > timerInfos := make(map[string]*commonpb.DataBlob)
528 > tMapEncoding := result["timer_map_encoding"].(string)
529 > tMap := result["timer_map"].(map[string][]byte)
530 > for key, value := range tMap {
531 > timerInfos[key] = p.NewDataBlob(value, tMapEncoding)
532 > }
533 > state.TimerInfos = timerInfos
534 >
535 > childExecutionInfos := make(map[int64]*commonpb.DataBlob)
536 > cMap := result["child_executions_map"].(map[int64][]byte)
537 > cMapEncoding := result["child_executions_map_encoding"].(string)
538 > for key, value := range cMap {
539 > childExecutionInfos[key] = p.NewDataBlob(value, cMapEncoding)
540 > }
541 > state.ChildExecutionInfos = childExecutionInfos
542 >
543 > requestCancelInfos := make(map[int64]*commonpb.DataBlob)
544 > rMapEncoding := result["request_cancel_map_encoding"].(string)
545 > rMap := result["request_cancel_map"].(map[int64][]byte)
546 > for key, value := range rMap {
547 > requestCancelInfos[key] = p.NewDataBlob(value, rMapEncoding)
548 > }
549 > state.RequestCancelInfos = requestCancelInfos
550 >
551 > signalInfos := make(map[int64]*commonpb.DataBlob)
552 > sMapEncoding := result["signal_map_encoding"].(string)
553 > sMap := result["signal_map"].(map[int64][]byte)
554 > for key, value := range sMap {
555 > signalInfos[key] = p.NewDataBlob(value, sMapEncoding)
556 > }
557 > state.SignalInfos = signalInfos
558 > state.SignalRequestedIDs = gocql.UUIDsToStringSlice(result["signal_requested"])
559 >
560 > chasmNodeBlobs := make(map[string]p.InternalChasmNode)
561 > chasmNodeEncoding, ok := result["chasm_node_map_encoding"].(string)
562 > if !ok {
563 return nil, serviceerror.NewInternal("GetWorkflowExecution failed: unknown chasm_node_map_encoding type")
564 }
565 > chasmNodeBytes, ok := result["chasm_node_map"].(map[string][]byte) mutable_state_store.go
566 > if !ok {
567 return nil, serviceerror.NewInternal("GetWorkflowExecution failed: unknown chasm_node_map type")
568 }
569 > for key, value := range chasmNodeBytes { mutable_state_store.go
570 > chasmNodeBlobs[key] = p.InternalChasmNode{
571 > CassandraBlob: p.NewDataBlob(value, chasmNodeEncoding),
572 > }
573 > }
574 > state.ChasmNodes = chasmNodeBlobs
575 >
576 > eList := result["buffered_events_list"].([]map[string]any) //nolint:revive // unchecked-type-assertion: consistent with surrounding Cassandra result parsing
577 > bufferedEventsBlobs := make([]*commonpb.DataBlob, 0, len(eList))
578 > for _, v := range eList {
579 blob := createHistoryEventBatchBlob(v)
580 bufferedEventsBlobs = append(bufferedEventsBlobs, blob)
581 }
582 > state.BufferedEvents = bufferedEventsBlobs mutable_state_store.go
583 >
584 > state.Checksum = p.NewDataBlob(result["checksum"].([]byte), result["checksum_encoding"].(string))
585 >
586 > dbVersion := int64(0)
587 > if dbRecordVersion, ok := result["db_record_version"]; ok {
588 > dbVersion = dbRecordVersion.(int64)
589 > } else {
590 dbVersion = 0
591 }
592
593 > return &p.InternalGetWorkflowExecutionResponse{ mutable_state_store.go
594 > State: state,
595 > DBRecordVersion: dbVersion,
596 > }, nil
597 }
598
go.temporal.io/server/common/persistence/serialization/serializer.go 11 introduced LOC · 2 ranges

Open complete file

552 }
553
554 > func (t *serializerImpl) ChecksumFromBlob(data *commonpb.DataBlob) (*persistencespb.Checksum, error) { serializer.go
555 > result := &persistencespb.Checksum{}
556 > err := Decode(data, result)
557 > if err != nil || result.GetFlavor() == enumsspb.CHECKSUM_FLAVOR_UNSPECIFIED {
558 > // If result is an empty struct (Flavor is unspecified), replace it with nil, because everywhere in the code checksum is pointer type.
559 > return nil, err
560 > }
561 return result, nil
562 }
610 }
611
612 > func (t *serializerImpl) ChasmNodeFromBlob(blob *commonpb.DataBlob) (*persistencespb.ChasmNode, error) { serializer.go
613 > result := &persistencespb.ChasmNode{}
614 > return result, Decode(blob, result)
615 > }
616
617 func (t *serializerImpl) TransferTaskInfoToBlob(info *persistencespb.TransferTaskInfo) (*commonpb.DataBlob, error) {
go.temporal.io/server/api/persistence/v1/executions.pb.go 10 introduced LOC · 2 ranges

Open complete file

3682 }
3683
3684 > func (x *Checksum) Reset() { executions.pb.go
3685 > *x = Checksum{}
3686 > mi := &file_temporal_server_api_persistence_v1_executions_proto_msgTypes[22]
3687 > ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
3688 > ms.StoreMessageInfo(mi)
3689 > }
3690
3691 func (x *Checksum) String() string {
3719 }
3720
3721 > func (x *Checksum) GetFlavor() v1.ChecksumFlavor { executions.pb.go
3722 > if x != nil {
3723 > return x.Flavor
3724 > }
3725 return v1.ChecksumFlavor(0)
3726 }
go.temporal.io/server/common/persistence/nosql/nosqlplugin/cassandra/gocql/uuid.go 7 introduced LOC · 1 range

Open complete file

16 func UUIDsToStringSlice(
17 item any,
18 > ) []string { uuid.go
19 > uuids := item.([]gocql.UUID)
20 > results := make([]string, len(uuids))
21 > for i, uuid := range uuids {
22 > results[i] = uuid.String()
23 > }
24 > return results
25 }
26
go.temporal.io/server/api/persistence/v1/chasm.pb.go 6 introduced LOC · 1 range

Open complete file

37 }
38
39 > func (x *ChasmNode) Reset() { chasm.pb.go
40 > *x = ChasmNode{}
41 > mi := &file_temporal_server_api_persistence_v1_chasm_proto_msgTypes[0]
42 > ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
43 > ms.StoreMessageInfo(mi)
44 > }
45
46 func (x *ChasmNode) String() string {
go.temporal.io/server/common/persistence/execution_manager.go 3 introduced LOC · 2 ranges

Open complete file

1194
1195 if internal.CassandraBlob != nil {
1196 > node, err = m.serializer.ChasmNodeFromBlob(internal.CassandraBlob) execution_manager.go
1197 } else {
1198 node, err = m.serializer.ChasmNodeFromBlobs(internal.Metadata, internal.Data)
1222 }
1223 if internState.Checksum != nil {
1224 > state.Checksum, err = m.serializer.ChecksumFromBlob(internState.Checksum) execution_manager.go
1225 > }
1226 if err != nil {
1227 return nil, err