activities.go ×9

Frontier kind: Code frontier

unlabeled · c_e6d471c7dffc

4 tests · 2176 LOC · 88 files · introduces 0 tests · 52 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges52 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
345 ranges2176 lines · 88 files · Browse complete extent
All tests (intent)
4 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.

1 file ranked by introduced lines: 52 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/worker/deletenamespace/deleteexecutions/activities.go 52 introduced LOC · 9 ranges

Open complete file

95 }
96
97 > func (a *LocalActivities) GetNextPageTokenActivity(ctx context.Context, params GetNextPageTokenParams) ([]byte, error) { activities.go
98 > ctx = headers.SetCallerName(ctx, params.Namespace.String())
99 >
100 > req := &manager.ListWorkflowExecutionsRequestV2{
101 > NamespaceID: params.NamespaceID,
102 > Namespace: params.Namespace,
103 > PageSize: params.PageSize,
104 > NextPageToken: params.NextPageToken,
105 > Query: sadefs.QueryWithAnyNamespaceDivision(""),
106 > }
107 >
108 > resp, err := a.visibilityManager.ListWorkflowExecutions(ctx, req)
109 > if err != nil {
110 a.logger.Error("Unable to list all workflows to get next page token.", tag.WorkflowNamespace(params.Namespace.String()), tag.WorkflowNamespaceID(params.NamespaceID.String()), tag.Error(err))
111 return nil, err
112 }
113
114 > return resp.NextPageToken, nil activities.go
115 }
116
117 > func (a *Activities) DeleteExecutionsActivity(ctx context.Context, params DeleteExecutionsActivityParams) (DeleteExecutionsActivityResult, error) { activities.go
118 > ctx = headers.SetCallerName(ctx, params.Namespace.String())
119 > logger := log.With(a.logger,
120 > tag.WorkflowNamespace(params.Namespace.String()),
121 > tag.WorkflowNamespaceID(params.NamespaceID.String()))
122 >
123 > progressCh := make(chan DeleteExecutionsActivityResult, 1)
124 > defer func() { close(progressCh) }()
125
126 > var result DeleteExecutionsActivityResult activities.go
127 > if activity.HasHeartbeatDetails(ctx) {
128 var previousAttemptResult DeleteExecutionsActivityResult
129 if err := activity.GetHeartbeatDetails(ctx, &previousAttemptResult); err != nil {
140 }
141
142 > go func() { activities.go
143 > heartbeatTicker := time.NewTicker(deleteWorkflowExecutionsActivityOptions.HeartbeatTimeout / 2)
144 > defer heartbeatTicker.Stop()
145 >
146 > var lastKnownProgress DeleteExecutionsActivityResult
147 > for {
148 > select {
149 > case progress, chOpen := <-progressCh:
150 > if !chOpen {
151 > // Stop heartbeating when a channel is closed, i.e., activity is completed.
152 > return
153 > }
154 lastKnownProgress = progress
155 case <-heartbeatTicker.C:
159 }()
160
161 > req := &manager.ListWorkflowExecutionsRequestV2{ activities.go
162 > NamespaceID: params.NamespaceID,
163 > Namespace: params.Namespace,
164 > PageSize: params.ListPageSize,
165 > NextPageToken: params.NextPageToken,
166 > Query: sadefs.QueryWithAnyNamespaceDivision(""),
167 > }
168 > resp, err := a.visibilityManager.ListWorkflowExecutions(ctx, req)
169 > if err != nil {
170 logger.Error("Unable to list all workflow executions.", tag.Error(err))
171 return result, err
172 }
173 > var rateLimiter *quotas.RateLimiterImpl activities.go
174 > deleteRPS, cancelDeleteRPSWatch := a.deleteActivityRPS(func(newRPS int) {
175 if rateLimiter != nil {
176 rateLimiter.SetRPS(float64(newRPS))
177 }
178 })
179 > defer cancelDeleteRPSWatch() activities.go
180 > rateLimiter = quotas.NewRateLimiter(float64(deleteRPS), deleteRPS)
181 >
182 > for _, execution := range resp.Executions {
183 err = rateLimiter.Wait(ctx)
184 if err != nil {