All Products
Search
Document Center

Batch Compute:Multiple tasks

Last Updated:Apr 12, 2018

In Batch Compute, a job can contain multiple tasks which have DAG dependencies between each other.

It means the next task starts to run only when the previous task is finished.

Example 1

Set the job description JSON as follows:

  1. {
  2. "Name": "my-job",
  3. "DAG": {
  4. ...
  5. "Dependencies": {
  6. "split": ["count"],
  7. "count": ["merge"]
  8. }
  9. }
  10. }
  • After split is finished, count starts to run and then merge starts to run in turn.
  • When merge is finished, the whole job finishes.

Example 2

Set the job description JSON as follows:

  1. {
  2. "Name": "my-job",
  3. "DAG": {
  4. ...
  5. "Dependencies": {
  6. "split": ["count1","count2"],
  7. "count1": ["merge"],
  8. "count2": ["merge"]
  9. }
  10. }
  11. }
  • After split is finished, count 1 and count 2 start to run simultaneously. After count 1 and count 2 are finished, merge starts to run.

  • When merge is finished, the whole job finishes.