operation.go ×8

Frontier kind: Joint frontier

unlabeled · c_3ffd8cf276b8

1 test · 3791 LOC · 135 files · introduces 1 test · 68 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges68 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
825 ranges3791 lines · 135 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.

2 files ranked by introduced lines: 68 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/chasm/lib/nexusoperation/operation.go 52 introduced LOC · 8 ranges

Open complete file

415 }
416
417 > func (o *Operation) SearchAttributes(_ chasm.Context) []chasm.SearchAttributeKeyValue { operation.go
418 > return []chasm.SearchAttributeKeyValue{
419 > EndpointSearchAttribute.Value(o.Endpoint),
420 > ServiceSearchAttribute.Value(o.Service),
421 > OperationSearchAttribute.Value(o.Operation),
422 > RequestIDSearchAttribute.Value(o.RequestId),
423 > StatusSearchAttribute.Value(operationExecutionStatus(o.Status).String()),
424 > }
425 > }
426
427 func (o *Operation) buildDescribeResponse(
519 }
520
521 > func (o *Operation) buildExecutionInfo(ctx chasm.Context) *nexuspb.NexusOperationExecutionInfo { operation.go
522 > requestData := o.RequestData.Get(ctx)
523 > key := ctx.ExecutionKey()
524 > info := &nexuspb.NexusOperationExecutionInfo{
525 > OperationId: key.BusinessID,
526 > RunId: key.RunID,
527 > Endpoint: o.Endpoint,
528 > Service: o.Service,
529 > Operation: o.Operation,
530 > Status: operationExecutionStatus(o.Status),
531 > State: PendingOperationState(o.Status),
532 > ScheduleToCloseTimeout: o.ScheduleToCloseTimeout,
533 > ScheduleToStartTimeout: o.ScheduleToStartTimeout,
534 > StartToCloseTimeout: o.StartToCloseTimeout,
535 > Attempt: o.Attempt,
536 > ScheduleTime: o.ScheduledTime,
537 > LastAttemptCompleteTime: o.LastAttemptCompleteTime,
538 > LastAttemptFailure: o.LastAttemptFailure,
539 > NextAttemptScheduleTime: o.NextAttemptScheduleTime,
540 > RequestId: o.RequestId,
541 > OperationToken: o.OperationToken,
542 > StateTransitionCount: ctx.ExecutionInfo().StateTransitionCount,
543 > StateSizeBytes: int64(ctx.ExecutionInfo().ApproximateStateSize),
544 > SearchAttributes: &commonpb.SearchAttributes{
545 > IndexedFields: o.Visibility.Get(ctx).CustomSearchAttributes(ctx),
546 > },
547 > NexusHeader: requestData.GetNexusHeader(),
548 > UserMetadata: requestData.GetUserMetadata(),
549 > Links: o.Links,
550 > Identity: requestData.GetIdentity(),
551 > }
552 >
553 > if cancellation, ok := o.Cancellation.TryGet(ctx); ok {
554 info.CancellationInfo = &nexuspb.NexusOperationExecutionCancellationInfo{
555 RequestedTime: cancellation.RequestedTime,
563 }
564
565 > if o.ScheduledTime != nil { operation.go
566 if o.ScheduleToCloseTimeout != nil {
567 info.ExpirationTime = timestamppb.New(o.ScheduledTime.AsTime().Add(o.ScheduleToCloseTimeout.AsDuration()))
677 }
678
679 > func operationExecutionStatus(status nexusoperationpb.OperationStatus) enumspb.NexusOperationExecutionStatus { operation.go
680 > switch status {
681 case nexusoperationpb.OPERATION_STATUS_SCHEDULED,
682 nexusoperationpb.OPERATION_STATUS_BACKING_OFF,
683 > nexusoperationpb.OPERATION_STATUS_STARTED: operation.go
684 > return enumspb.NEXUS_OPERATION_EXECUTION_STATUS_RUNNING
685 case nexusoperationpb.OPERATION_STATUS_SUCCEEDED:
686 return enumspb.NEXUS_OPERATION_EXECUTION_STATUS_COMPLETED
700 // PendingOperationState maps a nexus operation status to the corresponding pending API state.
701 // Returns PENDING_NEXUS_OPERATION_STATE_UNSPECIFIED for non-pending or unspecified statuses.
702 > func PendingOperationState(status nexusoperationpb.OperationStatus) enumspb.PendingNexusOperationState { operation.go
703 > switch status {
704 case nexusoperationpb.OPERATION_STATUS_SCHEDULED:
705 return enumspb.PENDING_NEXUS_OPERATION_STATE_SCHEDULED
706 case nexusoperationpb.OPERATION_STATUS_BACKING_OFF:
707 return enumspb.PENDING_NEXUS_OPERATION_STATE_BACKING_OFF
708 > case nexusoperationpb.OPERATION_STATUS_STARTED: operation.go
709 > return enumspb.PENDING_NEXUS_OPERATION_STATE_STARTED
710 default:
711 return enumspb.PENDING_NEXUS_OPERATION_STATE_UNSPECIFIED
go.temporal.io/server/chasm/lib/nexusoperation/gen/nexusoperationpb/v1/operation.pb.go 16 introduced LOC · 3 ranges

Open complete file

712 func (*OperationRequestData) ProtoMessage() {}
713
714 > func (x *OperationRequestData) ProtoReflect() protoreflect.Message { operation.pb.go
715 > mi := &file_temporal_server_chasm_lib_nexusoperation_proto_v1_operation_proto_msgTypes[4]
716 > if x != nil {
717 > ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
718 > if ms.LoadMessageInfo() == nil {
719 > ms.StoreMessageInfo(mi)
720 > }
721 > return ms
722 }
723 return mi.MessageOf(x)
743 }
744
745 > func (x *OperationRequestData) GetUserMetadata() *v12.UserMetadata { operation.pb.go
746 > if x != nil {
747 > return x.UserMetadata
748 > }
749 return nil
750 }
751
752 > func (x *OperationRequestData) GetIdentity() string { operation.pb.go
753 > if x != nil {
754 > return x.Identity
755 > }
756 return ""
757 }