mutable_state_rebuilder.go ×4

Frontier kind: Code frontier

unlabeled · c_7c1eb335a255

53 tests · 4174 LOC · 187 files · introduces 0 tests · 35 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges35 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
609 ranges4174 lines · 187 files · Browse complete extent
All tests (intent)
53 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.

2 files ranked by introduced lines: 35 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/historybuilder/history_builder.go 27 introduced LOC · 1 range

Open complete file

99 }
100
101 > func NewImmutable(histories ...[]*historypb.HistoryEvent) *HistoryBuilder { history_builder.go
102 > lastHistory := histories[len(histories)-1]
103 > lastEvent := lastHistory[len(lastHistory)-1]
104 > return &HistoryBuilder{
105 > EventStore: EventStore{
106 > state: HistoryBuilderStateImmutable,
107 > timeSource: nil,
108 > taskIDGenerator: nil,
109 >
110 > version: lastEvent.GetVersion(),
111 > nextEventID: lastEvent.GetEventId() + 1,
112 >
113 > workflowFinished: false,
114 >
115 > dbBufferBatch: nil,
116 > dbClearBuffer: false,
117 > memEventsBatches: histories,
118 > memLatestBatch: nil,
119 > memBufferBatch: nil,
120 > scheduledIDToStartedID: nil,
121 > requestIDToEventID: nil,
122 >
123 > metricsHandler: nil,
124 > },
125 > EventFactory: EventFactory{},
126 > }
127 > }
128
129 func NewImmutableForUpdateNextEventID(lastVersionHistoryItem *historyspb.VersionHistoryItem) *HistoryBuilder {
go.temporal.io/server/service/history/workflow/mutable_state_rebuilder.go 8 introduced LOC · 4 ranges

Open complete file

91 // close the transaction.
92 // Previously this comment was here: must generate the activity timer / user timer at the very end
93 > taskGenerator := GetTaskGeneratorProvider().NewTaskGenerator(b.shard, b.mutableState) mutable_state_rebuilder.go
94 > if err := taskGenerator.GenerateActivityTimerTasks(); err != nil {
95 return nil, err
96 }
97 > if err := taskGenerator.GenerateUserTimerTasks(); err != nil { mutable_state_rebuilder.go
98 return nil, err
99 }
100 > b.mutableState.SetHistoryBuilder(historybuilder.NewImmutable(history...)) mutable_state_rebuilder.go
101 > return newMutableState, nil
102 }
103
691
692 // The length of newRunHistory can be zero in resend case
693 > if len(newRunHistory) == 0 { mutable_state_rebuilder.go
694 > return nil, nil
695 > }
696
697 if b.mutableState.GetExecutionState().Status == enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING {