Schedule
Schedules tasks in an external database.
Usage
schedule (schedule-data, connect-string, user, password : task-id-data)
Details
Adds tasks based on schedule-data to a task table in
an external database reachable through connect-string, in a schema
accessible by user via password. The table will be
created if it does not already exist. The table name is defined
in the Theseus.properties file and has the following structure:
(task_id NUMBER, schedule VARCHAR (255));
Notes
- The operator does not do any interpretation on the contents
of schedule-data - this is left as a job for the
scheduler itself (allows implementation to be flexible).
- Schedule information is extracted from the first attribute
of the schedule-data relation, so the name of this
attribute is not important.
- The Theseus.properties property for the name of the task table
is
operators/tasks/table_name.
- Connect strings must be specified in the usual JDBC format.
- The Theseus.properties file must contain the name of the driver
being used (e.g., sun.jdbc.odbc.JdbcOdbcDriver) assigned to the
operators/jdbc/driver variable.
Known Bugs
Example
Using the input:
RELATION schedules: info char
05 08-17 1,3,5 * * c:\homeseekers.plan c:\homeseekers.data
06 12-15 1-5 * * c:\news-agent.plan c:\news-agent.data
when executing the plan:
PLAN test
{
INPUT: stream schedules
OUTPUT: stream tasks
BODY
{
schedule (schedules, "jdbc:oracle:thin:@mydb", "scott", "tiger" : tasks)
}
}
will write the data to the task table and will output (assuming
these are the first two tasks to be entered):
----------------------------------------------
RELATION: test_tasks
attrs: task_id
----------------------------------------------
1
2
----------------------------------------------