workflow_handler.go ×8

Frontier kind: Code frontier

unlabeled · c_8517de5dfe0d

6 tests · 3974 LOC · 201 files · introduces 0 tests · 39 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges39 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
601 ranges3974 lines · 201 files · Browse complete extent
All tests (intent)
6 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: 39 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/frontend/workflow_handler.go 39 introduced LOC · 8 ranges

Open complete file

6037 }
6038
6039 > if !wh.config.EnableBatcher(request.Namespace) { workflow_handler.go
6040 return nil, errBatchAPINotAllowed
6041 }
6042
6043 > execution := &commonpb.WorkflowExecution{ workflow_handler.go
6044 > WorkflowId: request.GetJobId(),
6045 > RunId: "",
6046 > }
6047 > resp, err := wh.DescribeWorkflowExecution(ctx, &workflowservice.DescribeWorkflowExecutionRequest{
6048 > Namespace: request.GetNamespace(),
6049 > Execution: execution,
6050 > })
6051 > if err != nil {
6052 return nil, err
6053 }
6054
6055 > executionInfo := resp.GetWorkflowExecutionInfo() workflow_handler.go
6056 > operationState := getBatchOperationState(executionInfo.GetStatus())
6057 > memo := executionInfo.GetMemo().GetFields()
6058 > operationReason := memo[batcher.BatchReasonMemo]
6059 > var reason string
6060 > err = payload.Decode(operationReason, &reason)
6061 > if err != nil {
6062 return nil, err
6063 }
6064 > var identity string workflow_handler.go
6065 > encodedBatcherIdentity := executionInfo.GetSearchAttributes().GetIndexedFields()[sadefs.BatcherUser]
6066 > err = payload.Decode(encodedBatcherIdentity, &identity)
6067 > if err != nil {
6068 return nil, err
6069 }
6071 // memo do not have this field, so they default to the zero value
6072 // BATCH_OPERATION_TYPE_UNSPECIFIED.
6073 > var operationType enumspb.BatchOperationType workflow_handler.go
6074 > if typePayload, ok := memo[batcher.BatchOperationTypeMemo]; ok {
6075 var operationTypeString string
6076 if err = payload.Decode(typePayload, &operationTypeString); err != nil {
6086 // started before it was recorded, or started by execution list rather than
6087 // query, do not have this field and default to an empty query.
6088 > var visibilityQuery string workflow_handler.go
6089 > if queryPayload, ok := memo[batcher.BatchOperationVisibilityQueryMemo]; ok {
6090 if err = payload.Decode(queryPayload, &visibilityQuery); err != nil {
6091 return nil, err
6095 // The explicit target executions are recorded in the memo at start time for
6096 // batch operations started by execution list rather than visibility query.
6097 > var executions []*commonpb.Execution workflow_handler.go
6098 > if executionsPayload, ok := memo[batcher.BatchOperationExecutionsMemo]; ok {
6099 if err = payload.Decode(executionsPayload, &executions); err != nil {
6100 return nil, err
6102 }
6103
6104 > batchOperationResp := &workflowservice.DescribeBatchOperationResponse{ workflow_handler.go
6105 > OperationType: operationType,
6106 > JobId: executionInfo.Execution.GetWorkflowId(),
6107 > State: operationState,
6108 > StartTime: executionInfo.StartTime,
6109 > CloseTime: executionInfo.CloseTime,
6110 > Identity: identity,
6111 > Reason: reason,
6112 > Query: visibilityQuery,
6113 > Executions: executions,
6114 > }
6115 > if executionInfo.GetStatus() == enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED {
6116 stats, err := wh.getCompletedBatchOperationStats(memo)
6117 if err != nil {