shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

Provider Scaling out Interface

Open avalon566 opened this issue 7 years ago • 8 comments

Sequence diagram

sequence diagram

Feature

  • [x] Create/Start Scaling job interface
  • [x] Query Scaling job interface
    • [x] List all Scaling job interface
    • [x] Show scaling progress and detail #3617
  • [x] Stop/Delete Scaling job interface

avalon566 avatar Oct 14 '19 09:10 avalon566

Reference #3077.

KomachiSion avatar Oct 14 '19 09:10 KomachiSion

In my opinion, Here are the http request apis:

  1. POST http://127.0.0.1:8080/shardingscaling/start for starting jobs;
  2. GET http://127.0.0.1:8080/shardingscaling/progress/{job_id} for query job progresses;
  3. DELETE http://127.0.0.1:8080/shardingscaling/stop/{job_Id} for stopping jobs.

ssxlulu avatar Dec 02 '19 02:12 ssxlulu

In my opinion, the stop interface should not use DELETE method, because this interface only stop the scaling job.

What's more all interface can add /job/ prefix like

/shardingscaling/job/start [POST]
/shardingscaling/job/progress/${jobId} [GET]
/shardingscaling/job/stop [POST]

KomachiSion avatar Dec 04 '19 07:12 KomachiSion

In my opinion, the stop interface should not use DELETE method, because this interface only stop the scaling job.

What's more all interface can add /job/ prefix like

/shardingscaling/job/start [POST]
/shardingscaling/job/progress/${jobId} [GET]
/shardingscaling/job/stop [POST]

Agree. The apis will be these.

ssxlulu avatar Dec 04 '19 08:12 ssxlulu

Talk about the response body:

  1. Start action's reponse body:
{
    "message":"Start job success!",
    "content":{
        "jobId":"0"
    }
}
  1. Query progress's response body:
{
  "message": "Get progress of the job success!",
  "content": {
    "jobId": "0",
    "job_name": "",
    "data_node_progress": [
      {
        "id": "{host}-{port}-{schema}",
        "stage": "prepare/history_data/realtime_data/stopped",
        "history_data_progress": [
          {
            "id": "{schema}-{table}-split#0",
            "expected_rows": 0,
            "sycned_rows": 0
          }
        ],
        "realtime_data_progress": {
          "id": "{schema}-realtime",
          "log_positon": 0,
          "delay_second": 0
        }
      }
    ]
  }
}
  1. Stop action's response body:
{
    "message":"Stop job success!",
    "content":""
}

ssxlulu avatar Dec 05 '19 01:12 ssxlulu

In order to keep the interface data format unified, the following structure is recommended

{
  errorCode: 0,
  errorMsg: null,
  model: {} // Main data
  success: true
}

wqzwh avatar Dec 17 '19 07:12 wqzwh

add interface for list all jobs:

/shardingscaling/job/list [GET]

ssxlulu avatar Dec 18 '19 07:12 ssxlulu

UI hand drawing

image image image

wqzwh avatar Dec 18 '19 10:12 wqzwh