Documentation ¶
Index ¶
- func GenerateIndexes(spec *execution.ParallelismSpec) []execution.ParallelIndex
- func GetDefaultIndex() execution.ParallelIndex
- func GetParallelStatus(job *execution.Job, tasks []execution.TaskRef) (execution.ParallelStatus, error)
- func GetParallelStatusCounters(indexes []execution.ParallelIndexStatus) execution.ParallelStatusCounters
- func GetParallelTaskSummary(job *execution.Job, tasks []execution.TaskRef) (execution.ParallelStatusSummary, error)
- func HashIndex(index execution.ParallelIndex) (string, error)
- func HashIndexes(indexes []execution.ParallelIndex) (map[int]string, map[string]int, error)
- type IndexCreationRequest
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateIndexes ¶
func GenerateIndexes(spec *execution.ParallelismSpec) []execution.ParallelIndex
GenerateIndexes generates the indexes for a ParallelismSpec. The order of results is guaranteed to be deterministic.
func GetDefaultIndex ¶
func GetDefaultIndex() execution.ParallelIndex
GetDefaultIndex returns the default ParallelIndex for a non-parallel job.
func GetParallelStatus ¶
func GetParallelStatus(job *execution.Job, tasks []execution.TaskRef) (execution.ParallelStatus, error)
GetParallelStatus returns the complete ParallelStatus for the Job.
func GetParallelStatusCounters ¶
func GetParallelStatusCounters(indexes []execution.ParallelIndexStatus) execution.ParallelStatusCounters
GetParallelStatusCounters returns the parallel task summary status of a Job according to a list of TaskRef.
func GetParallelTaskSummary ¶
func GetParallelTaskSummary(job *execution.Job, tasks []execution.TaskRef) (execution.ParallelStatusSummary, error)
GetParallelTaskSummary returns the parallel task summary status of a Job according to a list of TaskRef.
func HashIndex ¶
func HashIndex(index execution.ParallelIndex) (string, error)
HashIndex returns a deterministic hash of a ParallelIndex. For example, the result of GetDefaultIndex() returns "gezdqo".
Example ¶
package main import ( "fmt" "github.com/furiko-io/furiko/pkg/execution/util/parallel" ) func main() { hash, err := parallel.HashIndex(parallel.GetDefaultIndex()) if err != nil { panic(err) } fmt.Println(hash) }
Output: gezdqo
func HashIndexes ¶
HashIndexes returns mapping of hashes of ParallelIndex. The first maps the slice index to the hash, and the second maps the hash to the slice index.
Types ¶
type IndexCreationRequest ¶
type IndexCreationRequest struct { ParallelIndex execution.ParallelIndex RetryIndex int64 Earliest time.Time }
IndexCreationRequest contains an index that should be created, and the earliest time it can be created.
func ComputeMissingIndexesForCreation ¶
func ComputeMissingIndexesForCreation( job *execution.Job, indexes []execution.ParallelIndex, ) ([]IndexCreationRequest, error)
ComputeMissingIndexesForCreation returns a list of expected indexes based on taskStatuses.