mutable_state_impl.go ×6

Frontier kind: Code frontier

unlabeled · c_81a4c1e5dd72

8 tests · 7481 LOC · 237 files · introduces 0 tests · 68 LOC · 4 files

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges68 lines · 4 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1452 ranges7481 lines · 237 files · Browse complete extent
All tests (intent)
8 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.

4 files ranked by introduced lines: 68 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/workflow/mutable_state_impl.go 32 introduced LOC · 6 ranges

Open complete file

1791 func (ms *MutableStateImpl) GetSignalInfo(
1792 initiatedEventID int64,
1793 > ) (*persistencespb.SignalInfo, bool) { mutable_state_impl.go
1794 > ri, ok := ms.pendingSignalInfoIDs[initiatedEventID]
1795 > return ri, ok
1796 > }
1797
1798 // GetSignalExternalInitiatedEvent get the details about signal external workflow
5186 command *commandpb.SignalExternalWorkflowExecutionCommandAttributes,
5187 targetNamespaceID namespace.ID,
5188 > ) (*historypb.HistoryEvent, *persistencespb.SignalInfo, error) { mutable_state_impl.go
5189 > opTag := tag.WorkflowActionExternalWorkflowSignalInitiated
5190 > if err := ms.checkMutability(opTag); err != nil {
5191 return nil, nil, err
5192 }
5193
5194 > event, batchID := ms.hBuilder.AddSignalExternalWorkflowExecutionInitiatedEvent(workflowTaskCompletedEventID, command, targetNamespaceID) mutable_state_impl.go
5195 > si, err := ms.ApplySignalExternalWorkflowExecutionInitiatedEvent(batchID, event, signalRequestID)
5196 > if err != nil {
5197 return nil, nil, err
5198 }
5199 // TODO merge active & passive task generation
5200 > if err := ms.taskGenerator.GenerateSignalExternalTasks( mutable_state_impl.go
5201 > event,
5202 > ); err != nil {
5203 return nil, nil, err
5204 }
5205 > return event, si, nil mutable_state_impl.go
5206 }
5207
5210 event *historypb.HistoryEvent,
5211 signalRequestID string,
5212 > ) (*persistencespb.SignalInfo, error) { mutable_state_impl.go
5213 > // TODO: Consider also writing signalRequestID to history event
5214 > initiatedEventID := event.GetEventId()
5215 > si := &persistencespb.SignalInfo{
5216 > Version: event.GetVersion(),
5217 > InitiatedEventBatchId: batchID,
5218 > InitiatedEventId: initiatedEventID,
5219 > RequestId: signalRequestID,
5220 > }
5221 >
5222 > ms.pendingSignalInfoIDs[si.InitiatedEventId] = si
5223 > ms.updateSignalInfos[si.InitiatedEventId] = si
5224 > ms.approximateSize += si.Size() + int64SizeBytes
5225 > ms.executionInfo.SignalExternalCount++
5226 >
5227 > ms.writeEventToCache(event)
5228 > return si, nil
5229 > }
5230
5231 func (ms *MutableStateImpl) AddUpsertWorkflowSearchAttributesEvent(
go.temporal.io/server/service/history/workflow/task_generator.go 25 introduced LOC · 3 ranges

Open complete file

670 func (r *TaskGeneratorImpl) GenerateSignalExternalTasks(
671 event *historypb.HistoryEvent,
672 > ) error { task_generator.go
673 >
674 > attr := event.GetSignalExternalWorkflowExecutionInitiatedEventAttributes()
675 > scheduledEventID := event.GetEventId()
676 > version := event.GetVersion()
677 > targetWorkflowID := attr.GetWorkflowExecution().GetWorkflowId()
678 > targetRunID := attr.GetWorkflowExecution().GetRunId()
679 > targetChildOnly := attr.GetChildWorkflowOnly()
680 >
681 > _, ok := r.mutableState.GetSignalInfo(scheduledEventID)
682 > if !ok {
683 return serviceerror.NewInternalf("it could be a bug, cannot get pending signal external workflow: %v", scheduledEventID)
684 }
685
686 > targetNamespaceID, err := r.getTargetNamespaceID(namespace.Name(attr.GetNamespace()), namespace.ID(attr.GetNamespaceId())) task_generator.go
687 > if err != nil {
688 return err
689 }
690
691 > r.mutableState.AddTasks(&tasks.SignalExecutionTask{ task_generator.go
692 > // TaskID, VisibilityTimestamp is set by shard
693 > WorkflowKey: r.mutableState.GetWorkflowKey(),
694 > TargetNamespaceID: targetNamespaceID.String(),
695 > TargetWorkflowID: targetWorkflowID,
696 > TargetRunID: targetRunID,
697 > TargetChildWorkflowOnly: targetChildOnly,
698 > InitiatedEventID: scheduledEventID,
699 > Version: version,
700 > })
701 >
702 > return nil
703 }
704
go.temporal.io/server/service/history/tasks/signal_task.go 9 introduced LOC · 3 ranges

Open complete file

29 )
30
31 > func (u *SignalExecutionTask) GetKey() Key { signal_task.go
32 > return NewImmediateKey(u.TaskID)
33 > }
34
35 func (u *SignalExecutionTask) GetVersion() int64 {
49 }
50
51 > func (u *SignalExecutionTask) GetVisibilityTime() time.Time { signal_task.go
52 > return u.VisibilityTimestamp
53 > }
54
55 func (u *SignalExecutionTask) SetVisibilityTime(timestamp time.Time) {
61 }
62
63 > func (u *SignalExecutionTask) GetType() enumsspb.TaskType { signal_task.go
64 > return enumsspb.TASK_TYPE_TRANSFER_SIGNAL_EXECUTION
65 > }
66
67 func (u *SignalExecutionTask) String() string {
go.temporal.io/server/api/enums/v1/task.pb.go 2 introduced LOC · 1 range

Open complete file

237 case TASK_TYPE_TRANSFER_START_CHILD_EXECUTION:
238 return "TransferStartChildExecution"
239 > case TASK_TYPE_TRANSFER_SIGNAL_EXECUTION: task.pb.go
240 > return "TransferSignalExecution"
241 case TASK_TYPE_TRANSFER_RESET_WORKFLOW:
242