26 #define JOB_STATUS_TYPES(apply) \
27 apply(NOT_AVAILABLE) \
41 #define SELECT_ENUM(passed) JB_##passed,
42 typedef enum { JOB_STATUS_TYPES(
SELECT_ENUM) } job_status;
45 extern const char* job_status_strings[];
82 job_t*
job_init(GTree* job_list, GSequence* job_queue,
char* type,
char* host,
83 int id,
int parent_id,
int user_id,
int group_id,
int priority,
char *jq_cmd_args);
#define SELECT_ENUM(passed)
Event handling operations.
void job_fail_agent(job_t *job, void *agent)
void job_fail_event(scheduler_t *scheduler, job_t *job)
Events that causes a job to be marked a failed.
void job_restart_event(scheduler_t *scheduler, arg_int *params)
job_t * job_init(GTree *job_list, GSequence *job_queue, char *type, char *host, int id, int parent_id, int user_id, int group_id, int priority, char *jq_cmd_args)
Create a new job.
job_t * next_job(GSequence *job_queue)
Gets the next job from the job queue.
void job_update(scheduler_t *scheduler, job_t *job)
int job_is_open(scheduler_t *scheduler, job_t *job)
Tests to see if there is still data available for this job.
void job_set_data(scheduler_t *scheduler, job_t *job, char *data, int sql)
char * job_next(job_t *job)
job_t * peek_job(GSequence *job_queue)
Gets the job that is at the top of the queue if there is one.
void job_remove_agent(job_t *job, GTree *job_list, void *agent)
void job_verbose_event(scheduler_t *scheduler, job_t *job)
void job_pause_event(scheduler_t *scheduler, arg_int *params)
Event to pause a job.
void job_status_event(scheduler_t *scheduler, arg_int *params)
Event to get the status of the scheduler or a specific job.
void job_destroy(job_t *job)
log_t * job_log(job_t *job)
void job_add_agent(job_t *job, void *agent)
Adds a new agent to the jobs list of agents.
void job_priority_event(scheduler_t *scheduler, arg_int *params)
void job_finish_agent(job_t *job, void *agent)
uint32_t active_jobs(GTree *job_list)
Gets the number of jobs that are not paused.
int32_t id
The identifier for this job.
GMutex * lock
Lock to maintain data integrity.
job_status status
The current status for the job.
uint32_t idx
The current index into the sql results.
int32_t group_id
The id of the group that created the job.
char * required_host
If not NULL, this job must run on a specific host machine.
GList * finished_agents
The list of agents that have completed their tasks.
gchar * message
Message that will be sent with job notification email.
gchar * jq_cmd_args
Command line arguments for this job.
int32_t user_id
The id of the user that created the job.
GList * failed_agents
The list of agents that failed while working.
char * agent_type
The type of agent used to analyze the data.
gchar * data
The data associated with this job (jq_args)
int32_t priority
Importance of the job, maps directory to unix priority.
int32_t parent_id
The identifier for the parent of this job (its queue id)
GList * running_agents
The list of agents assigned to this job that are still working.
PGresult * db_result
Results from the sql query (if any)
log_t * log
The log to print any agent logging messages to.
int32_t verbose
The verbose level for all of the agents in this job.