mutable_state_mock.go ×10

Frontier kind: Code frontier

unlabeled · c_66bd34d09ac7

3 tests · 4351 LOC · 191 files · introduces 0 tests · 99 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
19 ranges99 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
662 ranges4351 lines · 191 files · Browse complete extent
All tests (intent)
3 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.

3 files ranked by introduced lines: 99 introduced LOC across 19 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/interfaces/mutable_state_mock.go 49 introduced LOC · 10 ranges

Open complete file

2338
2339 // GetExternalPayloadCount mocks base method.
2340 > func (m *MockMutableState) GetExternalPayloadCount() int64 { mutable_state_mock.go
2341 > m.ctrl.T.Helper()
2342 > ret := m.ctrl.Call(m, "GetExternalPayloadCount")
2343 > ret0, _ := ret[0].(int64)
2344 > return ret0
2345 > }
2346
2347 // GetExternalPayloadCount indicates an expected call of GetExternalPayloadCount.
2348 > func (mr *MockMutableStateMockRecorder) GetExternalPayloadCount() *gomock.Call { mutable_state_mock.go
2349 > mr.mock.ctrl.T.Helper()
2350 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExternalPayloadCount", reflect.TypeOf((*MockMutableState)(nil).GetExternalPayloadCount))
2351 > }
2352
2353 // GetExternalPayloadSize mocks base method.
2354 > func (m *MockMutableState) GetExternalPayloadSize() int64 { mutable_state_mock.go
2355 > m.ctrl.T.Helper()
2356 > ret := m.ctrl.Call(m, "GetExternalPayloadSize")
2357 > ret0, _ := ret[0].(int64)
2358 > return ret0
2359 > }
2360
2361 // GetExternalPayloadSize indicates an expected call of GetExternalPayloadSize.
2362 > func (mr *MockMutableStateMockRecorder) GetExternalPayloadSize() *gomock.Call { mutable_state_mock.go
2363 > mr.mock.ctrl.T.Helper()
2364 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExternalPayloadSize", reflect.TypeOf((*MockMutableState)(nil).GetExternalPayloadSize))
2365 > }
2366
2367 // GetFirstRunID mocks base method.
2381
2382 // GetHistorySize mocks base method.
2383 > func (m *MockMutableState) GetHistorySize() int64 { mutable_state_mock.go
2384 > m.ctrl.T.Helper()
2385 > ret := m.ctrl.Call(m, "GetHistorySize")
2386 > ret0, _ := ret[0].(int64)
2387 > return ret0
2388 > }
2389
2390 // GetHistorySize indicates an expected call of GetHistorySize.
2391 > func (mr *MockMutableStateMockRecorder) GetHistorySize() *gomock.Call { mutable_state_mock.go
2392 > mr.mock.ctrl.T.Helper()
2393 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHistorySize", reflect.TypeOf((*MockMutableState)(nil).GetHistorySize))
2394 > }
2395
2396 // GetInheritedBuildId mocks base method.
2797
2798 // GetUpdateCondition mocks base method.
2799 > func (m *MockMutableState) GetUpdateCondition() (int64, int64) { mutable_state_mock.go
2800 > m.ctrl.T.Helper()
2801 > ret := m.ctrl.Call(m, "GetUpdateCondition")
2802 > ret0, _ := ret[0].(int64)
2803 > ret1, _ := ret[1].(int64)
2804 > return ret0, ret1
2805 > }
2806
2807 // GetUpdateCondition indicates an expected call of GetUpdateCondition.
2808 > func (mr *MockMutableStateMockRecorder) GetUpdateCondition() *gomock.Call { mutable_state_mock.go
2809 > mr.mock.ctrl.T.Helper()
2810 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUpdateCondition", reflect.TypeOf((*MockMutableState)(nil).GetUpdateCondition))
2811 > }
2812
2813 // GetUpdateOutcome mocks base method.
3613
3614 // SetUpdateCondition mocks base method.
3615 > func (m *MockMutableState) SetUpdateCondition(arg0, arg1 int64) { mutable_state_mock.go
3616 > m.ctrl.T.Helper()
3617 > m.ctrl.Call(m, "SetUpdateCondition", arg0, arg1)
3618 > }
3619
3620 // SetUpdateCondition indicates an expected call of SetUpdateCondition.
3621 > func (mr *MockMutableStateMockRecorder) SetUpdateCondition(arg0, arg1 any) *gomock.Call { mutable_state_mock.go
3622 > mr.mock.ctrl.T.Helper()
3623 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetUpdateCondition", reflect.TypeOf((*MockMutableState)(nil).SetUpdateCondition), arg0, arg1)
3624 > }
3625
3626 // SetVersioningRevisionNumber mocks base method.
go.temporal.io/server/service/history/ndc/conflict_resolver.go 46 introduced LOC · 7 ranges

Open complete file

116 ctx context.Context,
117 branchIndex int32,
118 > ) (historyi.MutableState, error) { conflict_resolver.go
119 >
120 > versionHistories := r.mutableState.GetExecutionInfo().GetVersionHistories()
121 > replayVersionHistory, err := versionhistory.GetVersionHistory(versionHistories, branchIndex)
122 > if err != nil {
123 return nil, err
124 }
125 > lastItem, err := versionhistory.GetLastVersionHistoryItem(replayVersionHistory) conflict_resolver.go
126 > if err != nil {
127 return nil, err
128 }
129
130 > executionInfo := r.mutableState.GetExecutionInfo() conflict_resolver.go
131 > executionState := r.mutableState.GetExecutionState()
132 > workflowKey := definition.NewWorkflowKey(
133 > executionInfo.NamespaceId,
134 > executionInfo.WorkflowId,
135 > executionState.RunId,
136 > )
137 > historySize := r.mutableState.GetHistorySize()
138 > externalPayloadSize := r.mutableState.GetExternalPayloadSize()
139 > externalPayloadCount := r.mutableState.GetExternalPayloadCount()
140 >
141 > rebuildMutableState, _, err := r.stateRebuilder.Rebuild(
142 > ctx,
143 > timestamp.TimeValue(executionState.StartTime),
144 > workflowKey,
145 > replayVersionHistory.GetBranchToken(),
146 > lastItem.GetEventId(),
147 > new(lastItem.GetVersion()),
148 > workflowKey,
149 > replayVersionHistory.GetBranchToken(),
150 > findStartRequestID(executionState),
151 > )
152 > if err != nil {
153 return nil, err
154 }
155
156 // after rebuilt verification
157 > rebuildVersionHistories := rebuildMutableState.GetExecutionInfo().GetVersionHistories() conflict_resolver.go
158 > rebuildVersionHistory, err := versionhistory.GetCurrentVersionHistory(rebuildVersionHistories)
159 > rebuildMutableState.GetExecutionInfo().PreviousTransitionHistory = r.mutableState.GetExecutionInfo().PreviousTransitionHistory
160 > rebuildMutableState.GetExecutionInfo().LastTransitionHistoryBreakPoint = r.mutableState.GetExecutionInfo().LastTransitionHistoryBreakPoint
161 > if err != nil {
162 return nil, err
163 }
164
165 > if !rebuildVersionHistory.Equal(replayVersionHistory) { conflict_resolver.go
166 return nil, serviceerror.NewInternal("ConflictResolver encounter mismatch version history after Rebuild")
167 }
168
169 // set the current branch index to target branch index
170 > if err := versionhistory.SetCurrentVersionHistoryIndex(versionHistories, branchIndex); err != nil { conflict_resolver.go
171 return nil, err
172 }
173 > rebuildMutableState.GetExecutionInfo().VersionHistories = versionHistories conflict_resolver.go
174 > rebuildMutableState.AddHistorySize(historySize)
175 > rebuildMutableState.AddExternalPayloadSize(externalPayloadSize)
176 > rebuildMutableState.AddExternalPayloadCount(externalPayloadCount)
177 > // set the update condition from original mutable state
178 > rebuildMutableState.SetUpdateCondition(r.mutableState.GetUpdateCondition())
179 >
180 > r.context.Clear()
181 > return rebuildMutableState, nil
182 }
go.temporal.io/server/common/persistence/versionhistory/version_histories.go 4 introduced LOC · 2 ranges

Open complete file

169
170 // SetCurrentVersionHistoryIndex set the current VersionHistory index.
171 > func SetCurrentVersionHistoryIndex(h *historyspb.VersionHistories, currentVersionHistoryIndex int32) error { version_histories.go
172 > if currentVersionHistoryIndex < 0 || currentVersionHistoryIndex >= int32(len(h.Histories)) {
173 return serviceerror.NewInternal("invalid current version history index.")
174 }
175
176 > h.CurrentVersionHistoryIndex = currentVersionHistoryIndex version_histories.go
177 > return nil
178 }
179