nexus_endpoint_store.go ×12

Frontier kind: Code frontier

unlabeled · c_35abe769013b

20 tests · 3107 LOC · 155 files · introduces 0 tests · 32 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges32 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
487 ranges3107 lines · 155 files · Browse complete extent
All tests (intent)
20 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: 32 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/sql/nexus_endpoint_store.go 32 introduced LOC · 12 ranges

Open complete file

43 ctx context.Context,
44 request *p.InternalCreateOrUpdateNexusEndpointRequest,
45 > ) error { nexus_endpoint_store.go
46 > id, retErr := primitives.ParseUUID(request.Endpoint.ID)
47 > if retErr != nil {
48 return serviceerror.NewInternalf("unable to parse endpoint ID as UUID: %v", retErr)
49 }
50
51 > retErr = s.txExecute(ctx, "CreateOrUpdateNexusEndpoint", func(tx sqlplugin.Tx) error { nexus_endpoint_store.go
52 > // Upsert table version row
53 > var result sql.Result
54 > var err error
55 > if request.LastKnownTableVersion == 0 {
56 > result, err = tx.InitializeNexusEndpointsTableVersion(ctx)
57 > } else {
58 result, err = tx.IncrementNexusEndpointsTableVersion(ctx, request.LastKnownTableVersion)
59 }
60
61 > err = checkUpdateResult(result, err, p.ErrNexusTableVersionConflict) nexus_endpoint_store.go
62 > if s.DB.IsDupEntryError(err) {
63 return &p.ConditionFailedError{Msg: err.Error()}
64 }
65 > if err != nil { nexus_endpoint_store.go
66 s.logger.Error("error during CreateOrUpdateNexusEndpoint", tag.Error(err))
67 return err
69
70 // Upsert Nexus endpoint row
71 > row := sqlplugin.NexusEndpointsRow{ nexus_endpoint_store.go
72 > ID: id,
73 > Version: request.Endpoint.Version,
74 > Data: request.Endpoint.Data.Data,
75 > DataEncoding: request.Endpoint.Data.EncodingType.String(),
76 > }
77 > if request.Endpoint.Version == 0 {
78 > result, err = tx.InsertIntoNexusEndpoints(ctx, &row)
79 > } else {
80 result, err = tx.UpdateNexusEndpoint(ctx, &row)
81 }
82 > err = checkUpdateResult(result, err, p.ErrNexusEndpointVersionConflict) nexus_endpoint_store.go
83 > if s.DB.IsDupEntryError(err) {
84 return p.ErrNexusEndpointVersionConflict
85 }
86
87 > return err nexus_endpoint_store.go
88 })
89 > return retErr nexus_endpoint_store.go
90 }
91