@@ -356,23 +356,21 @@ The procedure for yielding incremental results is specified by the
356
356
YieldIncrementalResults(data, errors, incrementalDataRecords):
357
357
358
358
- Let {graph} be the result of {GraphFromRecords(incrementalDataRecords)}.
359
- - Let {pendingResults } be the result of {GetNonEmptyNewPending (graph)}.
360
- - Update {graph} to the subgraph rooted at nodes in {pendingResults }.
359
+ - Let {rootNodes } be the result of {GetNewRootNodes (graph)}.
360
+ - Update {graph} to the subgraph rooted at nodes in {rootNodes }.
361
361
- Yield the result of {GetInitialResult(data, errors, pendingResults)}.
362
362
- For each completed child Pending Incremental Data node of a root node in
363
363
{graph}:
364
364
- Let {incrementalDataRecord} be the Pending Incremental Data for that node;
365
365
let {result} be the corresponding completed result.
366
366
- If {data} on {result} is {null}:
367
- - Initialize {completed} to an empty list.
368
367
- Let {parents} be the parent nodes of {executionGroup}.
369
368
- Initialize {completed} to an empty list.
370
- - For each {pendingResult } of {parents}:
369
+ - For each {node } of {parents}:
371
370
- Append {GetCompletedEntry(parent, errors)} to {completed}.
372
- - Remove {pendingResult} and all of its descendant nodes from {graph},
373
- except for any descendant Incremental Data Record nodes with other
374
- parents.
375
- - Let {hasNext} be {false}, if {graph} is empty.
371
+ - Remove {node} and all of its descendant nodes from {graph}, except for
372
+ any descendant Incremental Data Record nodes with other parents.
373
+ - Let {hasNext} be {false} if {graph} is empty; otherwise, {true}.
376
374
- Yield an unordered map containing {completed} and {hasNext}.
377
375
- Continue to the next completed Pending Incremental Data node.
378
376
- Replace {node} in {graph} with a new node corresponding to the Completed
@@ -386,20 +384,21 @@ YieldIncrementalResults(data, errors, incrementalDataRecords):
386
384
- If {completedIncrementalDataNodes} is empty, continue to the next completed
387
385
Pending Incremental Data Node.
388
386
- Initialize {incremental} to an empty list.
389
- - For each {node} of {completedIncrementalDataNodes}:
390
- - Let {incrementalDataRecord} be the corresponding record for {node}.
387
+ - For each {completedIncrementalDataNode} of {completedIncrementalDataNodes}:
388
+ - Let {incrementalDataRecord} be the corresponding record for
389
+ {completedIncrementalDataNode}.
391
390
- Append {GetIncrementalEntry(incrementalDataRecord, graph)} to
392
391
{incremental}.
393
392
- Remove {node} from {graph}.
394
393
- Initialize {completed} to an empty list.
395
- - For each {pendingResult } of {completedDeferredFragments}:
396
- - Append {GetCompletedEntry(pendingResult )} to {completed}.
397
- - Remove {pendingResult } from {graph}, promoting its child Deferred Fragment
398
- nodes to root nodes.
399
- - Let {newPendingResults } be the result of {GetNonEmptyNewPending (graph)}.
400
- - Add all nodes in {newPendingResults } to {pendingResults }.
401
- - Update {graph} to the subgraph rooted at nodes in {pendingResults }.
402
- - Let {pending} be the result of {GetPendingEntry(newPendingResults )}.
394
+ - For each {completedDeferredFragment } of {completedDeferredFragments}:
395
+ - Append {GetCompletedEntry(completedDeferredFragment )} to {completed}.
396
+ - Remove {completedDeferredFragment } from {graph}, promoting its child
397
+ Deferred Fragment nodes to root nodes.
398
+ - Let {newRootNodes } be the result of {GetNewRootNodes (graph)}.
399
+ - Add all nodes in {newRootNodes } to {rootNodes }.
400
+ - Update {graph} to the subgraph rooted at nodes in {rootNodes }.
401
+ - Let {pending} be the result of {GetPendingEntry(newRootNodes )}.
403
402
- Yield the result of {GetIncrementalResult(graph, incremental, completed,
404
403
pending)}.
405
404
- Complete this incremental result stream.
@@ -417,7 +416,7 @@ GraphFromRecords(incrementalDataRecords, graph):
417
416
to {newGraph}, or the {parent} is not defined.
418
417
- Return {newGraph}.
419
418
420
- GetNonEmptyNewPending (graph):
419
+ GetNewRootNodes (graph):
421
420
422
421
- Initialize {newPendingResults} to the empty set.
423
422
- Initialize {rootNodes} to the set of root nodes in {graph}.
0 commit comments