THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
GET: http://{jm_rest_address:port}/blocklist
Request: {}
Response:
Code Block | ||
---|---|---|
| ||
{ /** This group only contains directly blocked task managers */ "blockedTaskManagers": [ { "id" : "container1", "action" : "MARK_BLOCKED", "startTimestamp" : "1652313600000", "endTimestamp" : "1652317200000", "cause" : "Hot machine" }, { "id" : "container2", "action" : "MARK_BLOCKED_AND_EVACUATE_TASKS", "startTimestamp" : "1652315400000", "endTimestamp" : "1652319000000", "cause" : "No space left on device" }, ... ], "blockedNodes": [ { "id" : "node1", "action" : "MARK_BLOCKED", "startTimestamp" : "1652313600000", "endTimestamp" : "1652317200000", "cause" : "Hot machine", /** The task managers on this blocked node */ "taskManagers" : ["container3", "container4"] }, ... ] } |
...
POST: http://{jm_rest_address:port}/blocklist/taskmanagers
Request
...
Code Block | ||
---|---|---|
| ||
{ [ { "id" : "node1/container1", "action" : "MARK_BLOCKED", "endTimestamp" : "1652317200000", "cause" : "Hot machine", "mergeOnConflict" : "true" }, { "id" : "node2/container2", "action" : "MARK_BLOCKED_AND_EVACUATE_TASKS", "timeout" : "3600000", "cause" : "No space left on device", }, ... ] } |
...
} |
Field meanings in requests:
- id: A string value that specifies the identifier of the blocked task manager or node.
- 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.
- timeout(optional): A long value that specifies the timeout (milliseconds).
- endTimestamp(optional): A long value that specifies the unix timestamp(milliseconds) at which the item should be removed.cause: A string value that represents the cause for blocking this task manager or node. 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.
- cause: A string value that specifies the cause for blocking this task manager or node.
- mergeOnConflict(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:
- If mergeOnConflict is false, return error.
- If mergeOnConflict is true. The newly added item and the existing item will be merged into one. Regarding the 3 fields, the merging algorithm:
- For action, merge(MARK_BLOCKED, MARK_BLOCKED_AND_EVACUATE_TASKS) = MARK_BLOCKED_AND_EVACUATE_TASKS
- For endTimestamp, merge(endTimestampA, endTimestampB) = max(endTimestampA, endTimestampB)
- For cause, we will combine all causes, merge("causeA", "causeB") = "causeA,causeB"
Response
Remove
DELETE: http://{jm_rest_address:port}/blocklist/node/<id>
...