operator_handler.go ×5

Frontier kind: Joint frontier

unlabeled · c_867116a061c0

1 test · 3513 LOC · 181 files · introduces 1 test · 65 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges65 lines · 3 files
Tests
1 test

Contains — complete concept membership

All code (extent)
525 ranges3513 lines · 181 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

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

go.temporal.io/server/service/frontend/operator_handler.go 43 introduced LOC · 5 ranges

Open complete file

547 ctx context.Context,
548 request *operatorservice.DeleteNamespaceRequest,
549 > ) (_ *operatorservice.DeleteNamespaceResponse, retError error) { operator_handler.go
550 > defer log.CapturePanic(h.logger, &retError)
551 >
552 > if request == nil {
553 > return nil, errRequestNotSet
554 > }
555
556 // If NamespaceDeleteDelay is not provided, the default delay configured in the cluster should be used.
557 > var namespaceDeleteDelay time.Duration operator_handler.go
558 > if request.NamespaceDeleteDelay == nil {
559 > namespaceDeleteDelay = h.config.DeleteNamespaceNamespaceDeleteDelay()
560 > } else {
561 namespaceDeleteDelay = request.NamespaceDeleteDelay.AsDuration()
562 }
563
564 // Execute workflow.
565 > wfParams := deletenamespace.DeleteNamespaceWorkflowParams{ operator_handler.go
566 > Namespace: namespace.Name(request.GetNamespace()),
567 > NamespaceID: namespace.ID(request.GetNamespaceId()),
568 > DeleteExecutionsConfig: deleteexecutions.DeleteExecutionsConfig{
569 > DeleteActivityRPS: h.config.DeleteNamespaceDeleteActivityRPS(),
570 > PageSize: h.config.DeleteNamespacePageSize(),
571 > PagesPerExecution: h.config.DeleteNamespacePagesPerExecution(),
572 > ConcurrentDeleteExecutionsActivities: h.config.DeleteNamespaceConcurrentDeleteExecutionsActivities(),
573 > },
574 > NamespaceDeleteDelay: namespaceDeleteDelay,
575 > }
576 >
577 > sdkClient := h.sdkClientFactory.GetSystemClient()
578 > run, err := sdkClient.ExecuteWorkflow(
579 > ctx,
580 > sdkclient.StartWorkflowOptions{
581 > TaskQueue: primitives.DefaultWorkerTaskQueue,
582 > ID: fmt.Sprintf("%s/%s", deletenamespace.WorkflowName, request.GetNamespace()),
583 > },
584 > deletenamespace.WorkflowName,
585 > wfParams,
586 > )
587 > if err != nil {
588 > return nil, serviceerror.NewUnavailablef(errUnableToStartWorkflowMessage, deletenamespace.WorkflowName, err)
589 > }
590
591 // Wait for the workflow to complete.
592 > var wfResult deletenamespace.DeleteNamespaceWorkflowResult operator_handler.go
593 > err = run.Get(ctx, &wfResult)
594 > if err != nil {
595 > return nil, delnserrors.ToServiceError(err, run.GetID(), run.GetRunID())
596 > }
597
598 > return &operatorservice.DeleteNamespaceResponse{ operator_handler.go
599 > DeletedNamespace: wfResult.DeletedNamespace.String(),
600 > }, nil
601 }
602
go.temporal.io/server/service/worker/deletenamespace/errors/errors.go 12 introduced LOC · 2 ranges

Open complete file

38 }
39
40 > func ToServiceError(err error, workflowID, runID string) error { errors.go
41 > var appErr *temporal.ApplicationError
42 > if errors.As(err, &appErr) {
43 > switch appErr.Type() {
44 > case InvalidArgumentErrType:
45 > return serviceerror.NewInvalidArgument(appErr.Message())
46 > case FailedPreconditionErrType:
47 > return serviceerror.NewFailedPrecondition(appErr.Message())
48 }
49 }
50 > return serviceerror.NewSystemWorkflow( errors.go
51 > &commonpb.WorkflowExecution{WorkflowId: workflowID, RunId: runID},
52 > err,
53 > )
54 }
go.temporal.io/server/common/testing/mocksdk/workflowrun_mock.go 10 introduced LOC · 2 ranges

Open complete file

57
58 // GetID mocks base method.
59 > func (m *MockWorkflowRun) GetID() string { workflowrun_mock.go
60 > m.ctrl.T.Helper()
61 > ret := m.ctrl.Call(m, "GetID")
62 > ret0, _ := ret[0].(string)
63 > return ret0
64 > }
65
66 // GetID indicates an expected call of GetID.
67 > func (mr *MockWorkflowRunMockRecorder) GetID() *gomock.Call { workflowrun_mock.go
68 > mr.mock.ctrl.T.Helper()
69 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetID", reflect.TypeOf((*MockWorkflowRun)(nil).GetID))
70 > }
71
72 // GetRunID mocks base method.