Documentation
¶
Index ¶
- func RunFeatureExtraction(config *config.Config, pool *pgxpool.Pool) error
- func RunJobQueue(queue *JobQueue, conn *pgxpool.Pool, cfg *config.Config) error
- type Job
- type JobQueue
- func BuildFeatureExtractionQueue(config *config.Config, lod2Batches [][]int64, lod3Batches [][]int64) (*JobQueue, error)
- func MainDBSetupJobQueue(config *config.Config) (*JobQueue, error)
- func NewJobQueue() *JobQueue
- func SupplementaryDBSetupJobQueue(config *config.Config) (*JobQueue, error)
- func SupplementaryJobQueue(config *config.Config) (*JobQueue, error)
- type JobType
- type Params
- type Runner
- type Task
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunFeatureExtraction ¶
Types ¶
type Job ¶
type Job struct {
JobID uuid.UUID `json:"job_id"`
BuildingIDs []int64 `json:"building_ids"`
Tasks []*Task `json:"tasks"`
EnqueuedAt time.Time `json:"enqueued_at"` // Timestamp when the job was enqueued
CreatedAt time.Time `json:"created_at"` // Creation timestamp
}
Job represents a batch of building IDs and the sequence of tasks to execute for them
type JobQueue ¶
type JobQueue struct {
// contains filtered or unexported fields
}
JobQueue represents a queue of jobs to be processed by the worker pool.
func BuildFeatureExtractionQueue ¶
func BuildFeatureExtractionQueue( config *config.Config, lod2Batches [][]int64, lod3Batches [][]int64, ) (*JobQueue, error)
BuildFeatureExtractionQueue creates a queue of jobs (one per batch) for both LOD2 and LOD3 building IDs.
func MainDBSetupJobQueue ¶
MainDBSetupJobQueue creates a queue with function scripts and main table scripts
func SupplementaryDBSetupJobQueue ¶
SupplementaryDBSetupJobQueue creates a queue with supplementary table scripts
func SupplementaryJobQueue ¶
SupplementaryJobQueue creates a queue with supplementary processing scripts
type Params ¶
type Params struct {
BuildingIDs []int64 `json:"building_ids"`
}
All required parameters for any SQL task
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner handles execution of tasks and jobs
type Task ¶
type Task struct {
TaskID uuid.UUID `json:"task_id"` // Unique identifier for the task
TaskType string `json:"task_type"` // e.g. "LOD2: 01_extract.sql"
Params Params `json:"params"` // Parameters for the task
SQLFile string `json:"sql_file"` // SQL file path
Priority int `json:"priority"` // Task priority (lower number = higher priority)
CreatedAt time.Time `json:"created_at"` // Creation timestamp
}
Task represents a single parameterised SQL script execution
Click to show internal directories.
Click to hide internal directories.