The JobStreamer control bus is a message passing system to agents.
-
Deploy a batch application. (And parse JavaBatch components from application classpath)
-
Register a job.
-
Delete a job.
-
Update a job.
-
Schedule a job.
-
Stop a schedule of job.
-
Delete a schedule of job.
Duct framework is used in the JobStreamer control bus.
Run a REPL and start a control bus as follows:
% lein repl
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_92-b14
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (dev)
:loaded
user=> (go)
POST /apps
{
:name "batch-example"
:description "Batch example"
:classpath [
"file:///home/app/target/classes"
"file:///var/m2/repository/xxx/xxx.jar"
"file:///var/m2/repository/yyy/yyy.jar"
"file:///var/m2/repository/zzz/zzz.jar"
]
}
NOTICE
Currently, JobStreamer supports only single application.
GET /:app-name/jobs
[
{
:job/id "JOB-1"
:job/restartable? true
}
]
POST /:app-name/jobs
Name | Type | Description |
---|---|---|
id | String | Required. The identity of the job. |
{
:id "JOB-1"
:steps [
{
:id "STEP-1"
:batchlet {
:ref "example.Batchlet"
}
}
]
}
GET /:app-name/job/:job-name
{
:db/id 17592186045451
:job/stats {
:total 49
:success 39
:failure 3
:average 2660/39
}
:job/schedule {
:schedule/active? true
:schedule/cron-notation "0 0 * * * ?"
}
:job/restartable? true
:job/name "MyShell"
:job/next-execution {
:job-execution/start-time #inst "2015-04-13T09:00:00.000-00:00"
}
:job/latest-execution {
:job-execution/batch-status {:db/ident :batch-status/queued}
:job-execution/create-time #inst "2015-04-13T07:00:00.006-00:00"
}
}
PUT /:app-name/job/:job-name
Name | Type | Description |
---|---|---|
id | String | Required. The identity of the job. |
DELETE /:app-name/job/:job-name
POST /:app-name/job/:job-name/schedule
Name | Type | Description |
---|---|---|
job/name | String | Required. A job name |
schedule/cron-notation | String | Required. A schedule by the cron notation. |
{
:job/name "MyShell"
:schedule/cron-notation "0 0 * * * ?"
}
POST /:app-name/job/:job-name/executions
GET /:app-name/job/:job-name/executions
[
{
:db/id 17592186045455
:job-execution/execution-id 119
:job-execution/create-time #inst "2015-04-08T04:54:15.703-00:00"
:job-execution/start-time #inst "2015-04-08T04:55:01.694-00:00"
:job-execution/end-time #inst "2015-04-08T04:55:01.796-00:00"
:job-execution/agent {
:agent/name "agent-1"
:agent/instance-id #uuid "5424c784-a145-4d3e-96f3-b9d99858611a"
}
:job-execution/batch-status {:db/ident :batch-status/completed}
:job-execution/job-parameters "{}"
}
]
GET /:app-name/job/:job-name/execution/:execution-id
GET /agents
GET /agent/:instance-id
{
:agent/name "agent-1"
:agent/port 4510
:agent/jobs {:running 0}
:command :ready
:agent/instance-id #uuid "d7dd0172-d272-41a4-aad2-56318b2234ee"
:agent/cpu-arch "amd64"
:agent/cpu-core 4
:agent/os-name "Linux"
:agent/stats {
:memory {
:physical {
:free 1070014464
:total 8281976832
}
:swap {
:free 34325999616
:total 34359734272
}
}
:cpu {
:process {
:load 0.024032586558044806
:time 13050000000
}
:system {
:load 0.07780040733197556
:load-average 2.43
}
}
}
:agent/os-version "3.19.3-3-ARCH"
:agent/host "127.0.0.1"
:agent/executions []
}
GET /:app-name/stats
{:agents 0, :jobs 3}