api.go ×6

Frontier kind: Code frontier

unlabeled · c_a6306f0d31f5

7 tests · 8207 LOC · 251 files · introduces 0 tests · 42 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges42 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1686 ranges8207 lines · 251 files · Browse complete extent
All tests (intent)
7 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: 42 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/queryworkflow/api.go 31 introduced LOC · 6 ranges

Open complete file

38 rawMatchingClient matchingservice.MatchingServiceClient,
39 matchingClient matchingservice.MatchingServiceClient,
40 > ) (_ *historyservice.QueryWorkflowResponse, retError error) { api.go
41 > scope := shardContext.GetMetricsHandler().WithTags(metrics.OperationTag(metrics.HistoryQueryWorkflowScope))
42 > namespaceID := namespace.ID(request.GetNamespaceId())
43 > err := api.ValidateNamespaceUUID(namespaceID)
44 > if err != nil {
45 return nil, err
46 }
47 > nsEntry, err := shardContext.GetNamespaceRegistry().GetNamespaceByID(namespaceID) api.go
48 > if err != nil {
49 return nil, err
50 }
51
52 > if len(request.Request.Execution.RunId) == 0 { api.go
53 request.Request.Execution.RunId, err = workflowConsistencyChecker.GetCurrentWorkflowRunID(
54 ctx,
61 }
62 }
63 > workflowKey := definition.NewWorkflowKey( api.go
64 > request.NamespaceId,
65 > request.Request.Execution.WorkflowId,
66 > request.Request.Execution.RunId,
67 > )
68 > workflowLease, err := workflowConsistencyChecker.GetWorkflowLease(
69 > ctx,
70 > nil,
71 > workflowKey,
72 > locks.PriorityHigh,
73 > )
74 > if err != nil {
75 return nil, err
76 }
77 > defer func() { api.go
78 > // Do not clear mutable state when query failed. Clear mutable state will fail other buffered pending queries.
79 > // Note: QueryWorkflow should not alter mutable state, so it is safe to ignore error and not clear ms.
80 > workflowLease.GetReleaseFn()(nil)
81 > }()
82
83 // Context metadata is automatically set during mutable state transaction close for operations that mutate state.
84 // Since QueryWorkflow is readonly and never closes the transaction, we explicitly call SetContextMetadata
85 // here to ensure successful requests have workflow metadata populated in the context.
86 > workflowLease.GetMutableState().SetContextMetadata(ctx) api.go
87 >
88 > req := request.GetRequest()
89 > _, mutableStateStatus := workflowLease.GetMutableState().GetWorkflowStateStatus()
90 > scope = scope.WithTags(metrics.StringTag("workflow_status", mutableStateStatus.String()))
91 > if mutableStateStatus != enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING && req.QueryRejectCondition != enumspb.QUERY_REJECT_CONDITION_NONE {
92 notOpenReject := req.GetQueryRejectCondition() == enumspb.QUERY_REJECT_CONDITION_NOT_OPEN
93 notCompletedCleanlyReject := req.GetQueryRejectCondition() == enumspb.QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY && mutableStateStatus != enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED
go.temporal.io/server/api/historyservice/v1/request_response.pb.go 8 introduced LOC · 2 ranges

Open complete file

5900 }
5901
5902 > func (x *QueryWorkflowRequest) GetNamespaceId() string { request_response.pb.go
5903 > if x != nil {
5904 > return x.NamespaceId
5905 > }
5906 return ""
5907 }
5908
5909 > func (x *QueryWorkflowRequest) GetRequest() *v1.QueryWorkflowRequest { request_response.pb.go
5910 > if x != nil {
5911 > return x.Request
5912 > }
5913 return nil
5914 }
go.temporal.io/server/service/history/history_engine.go 3 introduced LOC · 1 range

Open complete file

500 ctx context.Context,
501 request *historyservice.QueryWorkflowRequest,
502 > ) (_ *historyservice.QueryWorkflowResponse, retErr error) { history_engine.go
503 > return queryworkflow.Invoke(ctx, request, e.shardContext, e.workflowConsistencyChecker, e.rawMatchingClient, e.matchingClient)
504 > }
505
506 func (e *historyEngineImpl) DescribeMutableState(