Package mindsdb.models
Class Job
java.lang.Object
mindsdb.models.Job
- All Implemented Interfaces:
AutoCloseable
The Job class represents a job with various attributes such as project, name,
query string, data, queries, start and end timestamps, next run timestamp,
schedule string, and create callback.
It provides constructors for creating a job instance and methods for updating
the job, refreshing the job, adding a query to the job, getting the job
history, and exiting the job.
Attributes:
- project: The project associated with the job.
- name: The name of the job.
- queryString: The query string associated with the job.
- data: Additional data for the job in JSON format.
- queries: A list of queries associated with the job.
- startAt: The timestamp when the job starts.
- endAt: The timestamp when the job ends.
- nextRunAt: The timestamp when the job runs next.
- scheduleStr: The schedule string for the job.
- createCallback: The callback function for creating the job.
Methods:
- Job(Project project, String name, Map<String, String> data, CreateJobCallback createCallback): Constructs a new Job instance with the specified attributes.
- Job(Project project, String name, CreateJobCallback createCallback): Constructs a new Job instance with the specified attributes, without data.
- Job(Project project, String name): Constructs a new Job instance with the specified attributes, without data and create callback.
- String toString(): Returns a string representation of the job.
- void exit(): Exits the job.
- void close(): Closes the job.
- void refresh(): Refreshes the job.
- void addQuery(Query query): Adds a query to the job.
- void addQuery(String query): Adds a query to the job.
- Table getHistory(): Gets the job history.
-
Constructor Summary
ConstructorDescriptionConstructs a new Job instance with the specified attributes, without data and create callback.Constructs a new Job instance with the specified attributes.Job
(Project project, String name, CreateJobCallback createCallback) Constructs a new Job instance with the specified attributes, without data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a query to the job.void
Adds a query to the job.void
close()
Closes the job by executing the create callback with the queries.void
exit()
Exits the job by executing the create callback with the queries.tech.tablesaw.api.Table
Gets the history of the job.void
refresh()
Refreshes the job by updating its data from the project.toString()
-
Constructor Details
-
Job
Constructs a new Job instance with the specified attributes.- Parameters:
project
- - the project associated with the jobname
- - the name of the jobdata
- - additional data for the job in JSON formatcreateCallback
- - the callback function for creating the job
-
Job
Constructs a new Job instance with the specified attributes, without data.- Parameters:
project
- - the project associated with the jobname
- - the name of the jobcreateCallback
- - the callback function for creating the job
-
Job
Constructs a new Job instance with the specified attributes, without data and create callback.- Parameters:
project
- - the project associated with the jobname
- - the name of the job
-
-
Method Details
-
addQuery
Adds a query to the job.- Parameters:
query
- The query to be added.
-
addQuery
Adds a query to the job.- Parameters:
sql
- The SQL query string to be added.
-
getHistory
public tech.tablesaw.api.Table getHistory()Gets the history of the job.- Returns:
- The history of the job as a Table.
-
refresh
public void refresh()Refreshes the job by updating its data from the project. -
exit
public void exit()Exits the job by executing the create callback with the queries. -
close
public void close()Closes the job by executing the create callback with the queries.- Specified by:
close
in interfaceAutoCloseable
-
toString
-