Documentation
¶
Index ¶
Constants ¶
const ( PreData = 0 // CREATE role, schemas, table. Data = 10000 // one COPY per table, restart for sequences and identity. PostData = 20000 // CREATE indexes, constraints, etc. )
Task number ranges for dump sections.
Allocate 10k numbers for each of dump sections. This allows to handle quite big schemas.
Variables ¶
var Number int
var Trace bool
Log extra debug messages
This will flood logs. Enable only when debugging the scheduler.
Functions ¶
func Compare ¶ added in v0.20.0
Compare tasks
Heavier tasks wins.
returns:
-1: a precedes b 0: a equals b +1: b precedes a
func TaskInit ¶ added in v1.0.0
func TaskInit(f initFunc) option
TaskInit append an init function to a plan
dispatch execute init functions on context of each task.
func Wait ¶ added in v1.0.0
Wait for a task instead of requiring it.
Wrap a requirement with Wait to mark it as waiting req.
func WorkerInit ¶ added in v0.21.0
func WorkerInit(f initFunc) option
WorkerInit append an init function to a plan
dispatch execute init functions on context of each workers.
Types ¶
type Mock ¶ added in v0.26.0
func (Mock) Checkpoint ¶ added in v1.0.0
type Plan ¶
type Plan struct {
// contains filtered or unexported fields
}
Plan holds task for parallel execution
func (*Plan) Add ¶
Add registers a task
Panics if task is already registered or if a task requirement is missing.
func (*Plan) Cardinality ¶ added in v1.0.0
func (*Plan) Checkpoint ¶ added in v0.30.0
Checkpoint add a waiter to the plan
nil reqs creates a checkpoint on all previous tasks.
Use this to wait for a section of plan. e.g. pre-data, data, etc.