Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. id: A string value that represents the identifier of the blocked task manager or node.
  2. action: An enum value(MARK_BLOCKED or MARK_BLOCKED_AND_EVACUATE_TASKS) that represents the block action when a task manager/node is marked as blocked.
  3. startTimestamp: A long value that represents the unix timestamp(milliseconds) of creating this item. 
  4. endTimestamp:  A long value that represents the unix timestamp(milliseconds) at which the item should be removed. If the blocked item is permanent, this value will be Long.MAX_VALUE(9223372036854775807).
  5. cause: A string value that represents the cause for blocking this task manager or node.

Add

When trying to add a taskmanager or node, if the corresponding taskmanager/node already exists in blocklist, we propose to introduce two processing behaviors:

  1. Return error, the URL will be 
    1. POST: http://{jm_rest_address:port}/blocklist/nodes/<id>
    2. POST: http://{jm_rest_address:port}/blocklist/taskmanagers

...

    1. /<id>
  1. Merge. The newly added item and the existing item will be merged into one, the URL will be:
    1. POST: http://{jm_rest_address:port}/blocklist/nodes/<id>:merge
    2. POST: http://{jm_rest_address:port}/blocklist/taskmanagers/<id>:merge

Request

Request body:

Code Block

Request

Request body:

Code Block
titleRequest Example
{
    [
"action" : "MARK_BLOCKED",
      {
            "id"endTimestamp/timeout" : "node11652317200000/container13600000",
            "action"cause" : "MARK_BLOCKEDHot machine",
            "endTimestamp" : "1652317200000",
            "cause" : "Hot machine",
			"allowMerge" : "true"
        },
        {
            "id" : "node2/container2",
            "action" : "MARK_BLOCKED_AND_EVACUATE_TASKS",
            "timeout" : "3600000",
            "cause" : "No space left on device"
        }, 
        ...
    ]
}

Field meanings in requests:

} 

Field meanings in requests:

  1. action
  2. id: A string value that specifies the identifier of the blocked task manager or node.
  3. action: An enum value(MARK_BLOCKED or MARK_BLOCKED_AND_EVACUATE_TASKS) that specifies the block action when a task manager/node is marked as blocked.
  4. timeout(optional): A long value that specifies the timeout (milliseconds).
  5. endTimestamp(optional): A long value that specifies the unix timestamp(milliseconds) at which the item should be removed. Note that only one of timeout and endTimestamp can be specified. If neither is specified, it means that the blocked item is permanent and will not be removed. If both are specified, will return error.
  6. cause: A string value that specifies the cause for blocking this task manager or node.
  7. allowMerge(optional): A boolean value that specifies whether to merge when a conflict occurs. The default value is false. 

When trying to add a taskmanager or node, if the corresponding taskmanager/node already exists in blocklist, we propose to introduce two processing behaviors:

...

  1. of timeout and endTimestamp can be specified. If neither is specified, it means that the blocked item is permanent and will not be removed. If both are specified, will return error.
  2. cause: A string value that specifies the cause for blocking this task manager or node.

When choosing Merge, the merge algorithms for the 3 fields(action, endTimestamp/timeout and cause) are as follows

...

:

  1. For action, merge(MARK_BLOCKED, MARK_BLOCKED_AND_EVACUATE_TASKS) = MARK_BLOCKED_AND_EVACUATE_TASKS
  2. For endTimestamp, merge(endTimestampA, endTimestampB) = max(endTimestampA, endTimestampB)
  3. For cause, we will combine all causes, merge("causeA", "causeB") = "causeA,causeB". If these two causes are the same, we will keep only one.

Response

  1. .

Response

When choosing Return error:

  1. If the taskmanager/node dose not existIf no conflict, the response code is 201(CREATED), the response body is the added items.
  2. If conflict occurs:If allowMerge is falsethe taskmanager/node already exists, the response code is 409(CONFLICT), and returns error.

When choosing Merge:

  1. If the taskmanager/node dose not exist, the response code is 201(CREATED), the response body is the added items.
  2. If the taskmanager/node already existsif allowMerge is true, the response code is 202(ACCEPTED), the response body is the merged items.

Remove

DELETE: http://{jm_rest_address:port}/blocklist/node/<id>

...