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