api.go ×8

Frontier kind: Code frontier

unlabeled · c_15ab404bca5c

2 tests · 3229 LOC · 154 files · introduces 0 tests · 73 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges73 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
516 ranges3229 lines · 154 files · Browse complete extent
All tests (intent)
2 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: 73 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/forcedeleteworkflowexecution/api.go 55 introduced LOC · 8 ranges

Open complete file

26 persistenceVisibilityMgr manager.VisibilityManager,
27 logger log.Logger,
28 > ) (_ *historyservice.ForceDeleteWorkflowExecutionResponse, retError error) { api.go
29 > req := request.Request
30 > execution := req.Execution
31 >
32 > logger = log.With(logger,
33 > tag.WorkflowNamespaceID(request.NamespaceId),
34 > tag.WorkflowID(execution.WorkflowId),
35 > tag.WorkflowRunID(execution.RunId),
36 > )
37 >
38 > archetypeID := request.GetArchetypeId()
39 > if archetypeID == chasm.UnspecifiedArchetypeID {
40 archetypeID = chasm.WorkflowArchetypeID
41 }
42
43 > if execution.RunId == "" { api.go
44 resp, err := persistenceExecutionMgr.GetCurrentExecution(ctx, &persistence.GetCurrentExecutionRequest{
45 ShardID: shardID,
54 }
55
56 > var warnings []string api.go
57 > var branchTokens [][]byte
58 > var startTime time.Time
59 > var closeTime *time.Time
60 >
61 > resp, err := persistenceExecutionMgr.GetWorkflowExecution(ctx, &persistence.GetWorkflowExecutionRequest{
62 > ShardID: shardID,
63 > NamespaceID: request.NamespaceId,
64 > WorkflowID: execution.WorkflowId,
65 > RunID: execution.RunId,
66 > ArchetypeID: archetypeID,
67 > })
68 > if err != nil {
69 if common.IsContextCanceledErr(err) || common.IsContextDeadlineExceededErr(err) {
70 return nil, err
93 }
94
95 > if err := persistenceExecutionMgr.DeleteCurrentWorkflowExecution(ctx, &persistence.DeleteCurrentWorkflowExecutionRequest{ api.go
96 > ShardID: shardID,
97 > NamespaceID: request.NamespaceId,
98 > WorkflowID: execution.WorkflowId,
99 > RunID: execution.RunId,
100 > ArchetypeID: archetypeID,
101 > }); err != nil {
102 return nil, err
103 }
104
105 > if err := persistenceExecutionMgr.DeleteWorkflowExecution(ctx, &persistence.DeleteWorkflowExecutionRequest{ api.go
106 > ShardID: shardID,
107 > NamespaceID: request.NamespaceId,
108 > WorkflowID: execution.WorkflowId,
109 > RunID: execution.RunId,
110 > ArchetypeID: archetypeID,
111 > }); err != nil {
112 return nil, err
113 }
114
115 > for _, branchToken := range branchTokens { api.go
116 if err := persistenceExecutionMgr.DeleteHistoryBranch(ctx, &persistence.DeleteHistoryBranchRequest{
117 ShardID: shardID,
128 // visibility queue processing is async. Operator can call this api again to delete visibility
129 // record again if this happens.
130 > if err := persistenceVisibilityMgr.DeleteWorkflowExecution(ctx, &manager.VisibilityDeleteWorkflowExecutionRequest{ api.go
131 > NamespaceID: namespace.ID(request.GetNamespaceId()),
132 > WorkflowID: execution.GetWorkflowId(),
133 > RunID: execution.GetRunId(),
134 > TaskID: math.MaxInt64,
135 > StartTime: startTime,
136 > CloseTime: closeTime,
137 > IsRetentionDelete: false,
138 > }); err != nil {
139 return nil, err
140 }
141
142 > return &historyservice.ForceDeleteWorkflowExecutionResponse{ api.go
143 > Response: &adminservice.DeleteWorkflowExecutionResponse{
144 > Warnings: warnings,
145 > },
146 > }, nil
147 }
go.temporal.io/server/common/persistence/visibility/manager/visibility_manager_mock.go 10 introduced LOC · 2 ranges

Open complete file

100
101 // DeleteWorkflowExecution mocks base method.
102 > func (m *MockVisibilityManager) DeleteWorkflowExecution(ctx context.Context, request *VisibilityDeleteWorkflowExecutionRequest) error { visibility_manager_mock.go
103 > m.ctrl.T.Helper()
104 > ret := m.ctrl.Call(m, "DeleteWorkflowExecution", ctx, request)
105 > ret0, _ := ret[0].(error)
106 > return ret0
107 > }
108
109 // DeleteWorkflowExecution indicates an expected call of DeleteWorkflowExecution.
110 > func (mr *MockVisibilityManagerMockRecorder) DeleteWorkflowExecution(ctx, request any) *gomock.Call { visibility_manager_mock.go
111 > mr.mock.ctrl.T.Helper()
112 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkflowExecution", reflect.TypeOf((*MockVisibilityManager)(nil).DeleteWorkflowExecution), ctx, request)
113 > }
114
115 // GetIndexName mocks base method.
go.temporal.io/server/api/historyservice/v1/request_response.pb.go 8 introduced LOC · 2 ranges

Open complete file

8059 }
8060
8061 > func (x *ForceDeleteWorkflowExecutionRequest) GetNamespaceId() string { request_response.pb.go
8062 > if x != nil {
8063 > return x.NamespaceId
8064 > }
8065 return ""
8066 }
8067
8068 > func (x *ForceDeleteWorkflowExecutionRequest) GetArchetypeId() uint32 { request_response.pb.go
8069 > if x != nil {
8070 > return x.ArchetypeId
8071 > }
8072 return 0
8073 }