registry.go ×4

Frontier kind: Code frontier

unlabeled · c_175ac4e4eae7

75 tests · 5215 LOC · 189 files · introduces 0 tests · 44 LOC · 4 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges44 lines · 4 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
970 ranges5215 lines · 189 files · Browse complete extent
All tests (intent)
75 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.

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

go.temporal.io/server/service/history/workflow/update/registry.go 16 introduced LOC · 4 ranges

Open complete file

138
139 // WithNamespace sets the namespace name to be used in Registry metrics and logs.
140 > func WithNamespace(ns string) Option { registry.go
141 > return func(r *registry) {
142 > r.instrumentation.namespace = ns
143 > }
144 }
145
146 // WithLogger sets the log.Logger to be used by Registry and its Updates.
147 > func WithLogger(l log.Logger) Option { registry.go
148 > return func(r *registry) {
149 > r.instrumentation.log = l
150 > }
151 }
152
153 // WithMetrics sets the metrics.Handler to be used by Registry and its Updates.
154 > func WithMetrics(m metrics.Handler) Option { registry.go
155 > return func(r *registry) {
156 > r.instrumentation.metrics = m
157 > }
158 }
159
160 // WithTracerProvider sets the trace.TracerProvider (and by extension the
161 // trace.Tracer) to be used by Registry and its Updates.
162 > func WithTracerProvider(t trace.TracerProvider) Option { registry.go
163 > return func(r *registry) {
164 > r.instrumentation.tracer = t.Tracer(telemetry.ComponentUpdateRegistry)
165 > }
166 }
167
go.temporal.io/server/service/history/workflow/context.go 14 introduced LOC · 3 ranges

Open complete file

1216 }
1217
1218 > func (c *ContextImpl) UpdateRegistry(ctx context.Context) update.Registry { context.go
1219 > if c.updateRegistry != nil && c.updateRegistry.FailoverVersion() != c.MutableState.GetCurrentVersion() {
1220 c.updateRegistry.Clear()
1221 c.updateRegistry = nil
1222 }
1223
1224 > if c.updateRegistry == nil { context.go
1225 > nsName := c.MutableState.GetNamespaceEntry().Name().String()
1226 >
1227 > c.updateRegistry = update.NewRegistry(
1228 > c.MutableState,
1229 > update.WithNamespace(nsName),
1230 > update.WithLogger(c.logger),
1231 > update.WithMetrics(c.metricsHandler),
1232 > update.WithTracerProvider(trace.SpanFromContext(ctx).TracerProvider()),
1233 > update.WithInFlightLimit(
1234 > func() int {
1235 return c.config.WorkflowExecutionMaxInFlightUpdates(nsName)
1236 },
1253 )
1254 }
1255 > return c.updateRegistry context.go
1256 }
1257
go.temporal.io/server/service/history/workflow/mutable_state_impl.go 10 introduced LOC · 3 ranges

Open complete file

1499 // state entry. Thus, for example, updates entries in Admitted state will be visited in the order that their Admitted
1500 // events were added to history.
1501 > func (ms *MutableStateImpl) VisitUpdates(visitor func(updID string, updInfo *persistencespb.UpdateInfo)) { mutable_state_impl.go
1502 > type updateEvent struct {
1503 > updId string
1504 > updInfo *persistencespb.UpdateInfo
1505 > eventId int64
1506 > }
1507 > var updateEvents []updateEvent
1508 > for updID, updInfo := range ms.executionInfo.GetUpdateInfos() {
1509 u := updateEvent{
1510 updId: updID,
1520 updateEvents = append(updateEvents, u)
1521 }
1522 > slices.SortFunc(updateEvents, func(u1, u2 updateEvent) int { return cmp.Compare(u1.eventId, u2.eventId) }) mutable_state_impl.go
1523
1524 > for _, u := range updateEvents { mutable_state_impl.go
1525 visitor(u.updId, u.updInfo)
1526 }
go.temporal.io/server/api/persistence/v1/executions.pb.go 4 introduced LOC · 1 range

Open complete file

942 }
943
944 > func (x *WorkflowExecutionInfo) GetUpdateInfos() map[string]*UpdateInfo { executions.pb.go
945 > if x != nil {
946 > return x.UpdateInfos
947 > }
948 return nil
949 }