context_impl.go ×5

Frontier kind: Code frontier

unlabeled · c_01c290af40cd

27 tests · 3763 LOC · 153 files · introduces 0 tests · 23 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges23 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
550 ranges3763 lines · 153 files · Browse complete extent
All tests (intent)
27 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: 23 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/shard/context_impl.go 23 introduced LOC · 5 ranges

Open complete file

1356 return s.getOrUpdateRemoteClusterInfoLocked(cluster).CurrentTime
1357 }
1358 > return s.timeSource.Now().UTC() context_impl.go
1359 }
1360
1361 > func (s *ContextImpl) getLastUpdatedTime() time.Time { context_impl.go
1362 > s.rLock()
1363 > defer s.rUnlock()
1364 > return s.lastUpdated
1365 > }
1366
1367 func (s *ContextImpl) handleReadError(err error) error {
1442 }
1443
1444 > func (s *ContextImpl) maybeRecordShardAcquisitionLatency(ownershipChanged bool) { context_impl.go
1445 > if ownershipChanged {
1446 > metrics.ShardContextAcquisitionLatency.With(s.GetMetricsHandler()).
1447 > Record(s.GetCurrentTime(s.GetClusterMetadata().GetCurrentClusterName()).Sub(s.getLastUpdatedTime()),
1448 > metrics.OperationTag(metrics.ShardInfoScope),
1449 > )
1450 > }
1451 }
1452
1453 > func (s *ContextImpl) createEngine() historyi.Engine { context_impl.go
1454 > s.contextTaggedLogger.Info("", tag.LifeCycleStarting, tag.ComponentShardEngine)
1455 > engine := s.engineFactory.CreateEngine(s)
1456 > engine.Start()
1457 > s.contextTaggedLogger.Info("", tag.LifeCycleStarted, tag.ComponentShardEngine)
1458 > return engine
1459 > }
1460
1461 // start should only be called by the controller.
1979 var engine historyi.Engine
1980 if !s.engineFuture.Ready() {
1981 > s.maybeRecordShardAcquisitionLatency(ownershipChanged) context_impl.go
1982 > engine = s.createEngine()
1983 > }
1984
1985 // NOTE: engine is created & started before setting shard state to acquired.