Skip to content

Commit f110fe5

Browse files
committed
add example for speculations
1 parent d1544ca commit f110fe5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

entity/speculation_tree.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,15 @@ type SpeculationTree struct {
88
Queue string
99
// Speculations is a list of speculation paths for this batch based on a graph of its
1010
// dependents.
11+
//
12+
// For e.g - Consider batches - queueA/batch/1, queueA/batch/2, queueA/batch/3
13+
// such that - queueA/batch/2 and queueA/batch/3 depend on queueA/batch/1
14+
//
15+
// Speculations for queueA/batch/1 - [{"path": "queueA/batch/1", "state": "scheduled", "score": 0.1}]
16+
// Speculations for queueA/batch/2 - [{"path": "queueA/batch/2", "state": "scheduled", "score": 0.9}, {"path": "queueA/batch/1//queueA/batch/2", "state": "scheduled", "score": 0.3}]
17+
// Speculations for queueA/batch/3 - [{"path": "queueA/batch/3", "state": "scheduled", "score": 0.9}, {"path": "queueA/batch/1//queueA/batch/3", "state": "scheduled", "score": 0.3}]
18+
//
19+
// Note that the key value pairs within the map could have additional information about the speculation path if needed.
20+
//
1121
Speculations []map[string]string
1222
}

0 commit comments

Comments
 (0)