24
24
25
25
//go:generate mockgen -copyright_file ../../../LICENSE -package $GOPACKAGE -source $GOFILE -destination delete_manager_mock.go
26
26
27
- package workflow
27
+ package deletemanager
28
28
29
29
import (
30
30
"context"
@@ -44,6 +44,8 @@ import (
44
44
"go.temporal.io/server/service/history/configs"
45
45
"go.temporal.io/server/service/history/shard"
46
46
"go.temporal.io/server/service/history/tasks"
47
+ "go.temporal.io/server/service/history/workflow"
48
+ wcache "go.temporal.io/server/service/history/workflow/cache"
47
49
"go.temporal.io/server/service/worker/archiver"
48
50
)
49
51
@@ -53,32 +55,32 @@ type (
53
55
ctx context.Context ,
54
56
nsID namespace.ID ,
55
57
we commonpb.WorkflowExecution ,
56
- ms MutableState ,
58
+ ms workflow. MutableState ,
57
59
workflowClosedVersion int64 ,
58
60
) error
59
61
DeleteWorkflowExecution (
60
62
ctx context.Context ,
61
63
nsID namespace.ID ,
62
64
we commonpb.WorkflowExecution ,
63
- weCtx Context ,
64
- ms MutableState ,
65
+ weCtx workflow. Context ,
66
+ ms workflow. MutableState ,
65
67
forceDeleteFromOpenVisibility bool ,
66
68
stage * tasks.DeleteWorkflowExecutionStage ,
67
69
) error
68
70
DeleteWorkflowExecutionByRetention (
69
71
ctx context.Context ,
70
72
nsID namespace.ID ,
71
73
we commonpb.WorkflowExecution ,
72
- weCtx Context ,
73
- ms MutableState ,
74
+ weCtx workflow. Context ,
75
+ ms workflow. MutableState ,
74
76
archiveIfEnabled bool ,
75
77
stage * tasks.DeleteWorkflowExecutionStage ,
76
78
) error
77
79
}
78
80
79
81
DeleteManagerImpl struct {
80
82
shard shard.Context
81
- historyCache Cache
83
+ workflowCache wcache. Cache
82
84
config * configs.Config
83
85
metricsHandler metrics.MetricsHandler
84
86
archivalClient archiver.Client
@@ -90,14 +92,14 @@ var _ DeleteManager = (*DeleteManagerImpl)(nil)
90
92
91
93
func NewDeleteManager (
92
94
shard shard.Context ,
93
- cache Cache ,
95
+ cache wcache. Cache ,
94
96
config * configs.Config ,
95
97
archiverClient archiver.Client ,
96
98
timeSource clock.TimeSource ,
97
99
) * DeleteManagerImpl {
98
100
deleteManager := & DeleteManagerImpl {
99
101
shard : shard ,
100
- historyCache : cache ,
102
+ workflowCache : cache ,
101
103
metricsHandler : shard .GetMetricsHandler (),
102
104
config : config ,
103
105
archivalClient : archiverClient ,
@@ -111,11 +113,11 @@ func (m *DeleteManagerImpl) AddDeleteWorkflowExecutionTask(
111
113
ctx context.Context ,
112
114
nsID namespace.ID ,
113
115
we commonpb.WorkflowExecution ,
114
- ms MutableState ,
116
+ ms workflow. MutableState ,
115
117
workflowClosedVersion int64 ,
116
118
) error {
117
119
118
- taskGenerator := taskGeneratorProvider .NewTaskGenerator (m .shard , ms )
120
+ taskGenerator := workflow . NewTaskGeneratorProvider () .NewTaskGenerator (m .shard , ms )
119
121
120
122
// We can make this task immediately because the task itself will keep rescheduling itself until the workflow is
121
123
// closed before actually deleting the workflow.
@@ -141,8 +143,8 @@ func (m *DeleteManagerImpl) DeleteWorkflowExecution(
141
143
ctx context.Context ,
142
144
nsID namespace.ID ,
143
145
we commonpb.WorkflowExecution ,
144
- weCtx Context ,
145
- ms MutableState ,
146
+ weCtx workflow. Context ,
147
+ ms workflow. MutableState ,
146
148
forceDeleteFromOpenVisibility bool ,
147
149
stage * tasks.DeleteWorkflowExecutionStage ,
148
150
) error {
@@ -164,8 +166,8 @@ func (m *DeleteManagerImpl) DeleteWorkflowExecutionByRetention(
164
166
ctx context.Context ,
165
167
nsID namespace.ID ,
166
168
we commonpb.WorkflowExecution ,
167
- weCtx Context ,
168
- ms MutableState ,
169
+ weCtx workflow. Context ,
170
+ ms workflow. MutableState ,
169
171
archiveIfEnabled bool ,
170
172
stage * tasks.DeleteWorkflowExecutionStage ,
171
173
) error {
@@ -187,8 +189,8 @@ func (m *DeleteManagerImpl) deleteWorkflowExecutionInternal(
187
189
ctx context.Context ,
188
190
namespaceID namespace.ID ,
189
191
we commonpb.WorkflowExecution ,
190
- weCtx Context ,
191
- ms MutableState ,
192
+ weCtx workflow. Context ,
193
+ ms workflow. MutableState ,
192
194
archiveIfEnabled bool ,
193
195
forceDeleteFromOpenVisibility bool ,
194
196
stage * tasks.DeleteWorkflowExecutionStage ,
@@ -264,8 +266,8 @@ func (m *DeleteManagerImpl) archiveWorkflowIfEnabled(
264
266
namespaceID namespace.ID ,
265
267
workflowExecution commonpb.WorkflowExecution ,
266
268
currentBranchToken []byte ,
267
- weCtx Context ,
268
- ms MutableState ,
269
+ weCtx workflow. Context ,
270
+ ms workflow. MutableState ,
269
271
metricsHandler metrics.MetricsHandler ,
270
272
) (deletionPromised bool , err error ) {
271
273
0 commit comments