tree.go ×12

Frontier kind: Code frontier

unlabeled · c_2619ae70aca3

173 tests · 2689 LOC · 93 files · introduces 0 tests · 40 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges40 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
551 ranges2689 lines · 93 files · Browse complete extent
All tests (intent)
173 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.

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

go.temporal.io/server/chasm/tree.go 37 introduced LOC · 12 ranges

Open complete file

2214 rt *RegistrableTask,
2215 taskList *[]*persistencespb.ChasmComponentAttributes_Task,
2216 > ) (skip bool) { tree.go
2217 > if rt.singletonMode == 0 {
2218 return false
2219 }
2248 }
2249
2250 > componentAttr := n.serializedNode.Metadata.GetComponentAttributes() tree.go
2251 > sortPureTasks := false
2252 >
2253 > for _, newTask := range newTasks {
2254 > if !newTask.attributes.IsValid() {
2255 return softassert.UnexpectedInternalErr(
2256 n.logger,
2259 }
2260
2261 > valid, err := n.validateTask( tree.go
2262 > validateContext,
2263 > TaskInvocation{TaskAttributes: newTask.attributes},
2264 > newTask.task,
2265 > )
2266 > if err != nil {
2267 return err
2268 }
2269 > if !valid { tree.go
2270 continue
2271 }
2272
2273 > registrableTask, ok := n.registry.taskFor(newTask.task) tree.go
2274 > if !ok {
2275 return softassert.UnexpectedInternalErr(
2276 n.logger,
2279 }
2280
2281 > taskBlob, err := n.serializeTaskWithCache(registrableTask, reflect.ValueOf(newTask.task)) tree.go
2282 > if err != nil {
2283 return err
2284 }
2285
2286 > componentTask := &persistencespb.ChasmComponentAttributes_Task{ tree.go
2287 > TypeId: registrableTask.taskTypeID,
2288 > Destination: newTask.attributes.Destination,
2289 > ScheduledTime: timestamppb.New(newTask.attributes.ScheduledTime),
2290 > Data: taskBlob,
2291 > VersionedTransition: nextVersionedTransition,
2292 > VersionedTransitionOffset: *taskOffset,
2293 > PhysicalTaskStatus: physicalTaskStatusNone,
2294 > }
2295 >
2296 > if registrableTask.isPureTask {
2297 if skip := n.applySingletonMode(registrableTask, &componentAttr.PureTasks); skip {
2298 continue
2307 }
2308
2309 > *taskOffset++ tree.go
2310 }
2311
2312 > if sortPureTasks { tree.go
2313 // pure tasks are sorted by scheduled time.
2314 slices.SortFunc(componentAttr.PureTasks, comparePureTasks)
2315 }
2316
2317 > return nil tree.go
2318 }
2319
3365 registrableTask *RegistrableTask,
3366 taskValue reflect.Value,
3367 > ) (*commonpb.DataBlob, error) { tree.go
3368 > taskBlob, err := serializeTask(registrableTask, taskValue)
3369 > if err != nil {
3370 return nil, err
3371 }
3372
3373 > n.taskValueCache[taskBlob] = taskValue tree.go
3374 > return taskBlob, nil
3375 }
3376
go.temporal.io/server/chasm/task.go 3 introduced LOC · 1 range

Open complete file

98 // IsValid reports whether the task attributes are well-formed. A Destination may only be set on
99 // immediate tasks; deferred tasks with a Destination are invalid.
100 > func (a *TaskAttributes) IsValid() bool { task.go
101 > return a.Destination == "" || a.IsImmediate()
102 > }