Class AbstractAsynchronousOperationHandlers<K extends OperationKey,R extends Serializable>
- java.lang.Object
-
- org.apache.flink.runtime.rest.handler.async.AbstractAsynchronousOperationHandlers<K,R>
-
- Type Parameters:
K
- type of the operation key under which the result future is storedR
- type of the operation result
- Direct Known Subclasses:
ClusterDataSetDeleteHandlers
,RescalingHandlers
,SavepointDisposalHandlers
public abstract class AbstractAsynchronousOperationHandlers<K extends OperationKey,R extends Serializable> extends Object
HTTP handlers for asynchronous operations.Some operations are long-running. To avoid blocking HTTP connections, these operations are executed in two steps. First, an HTTP request is issued to trigger the operation asynchronously. The request will be assigned a trigger id, which is returned in the response body. Next, the returned id should be used to poll the status of the operation until it is finished.
An operation is triggered by sending an HTTP
POST
request to a registeredurl
. The HTTP request may contain a JSON body to specify additional parameters, e.g.,{ "target-directory": "/tmp" }
As written above, the response will contain a request id, e.g.,
{ "request-id": "7d273f5a62eb4730b9dea8e833733c1e" }
To poll for the status of an ongoing operation, an HTTP
GET
request is issued tourl/:triggerid
. If the specified savepoint is still ongoing, the response will be{ "status": { "id": "IN_PROGRESS" } }
If the specified operation has completed, the status id will transition to
COMPLETED
, and the response will additionally contain information about the operation result:{ "status": { "id": "COMPLETED" }, "operation": { "result": "/tmp/savepoint-d9813b-8a68e674325b" } }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractAsynchronousOperationHandlers.StatusHandler<T extends RestfulGateway,V,M extends MessageParameters>
Handler which will be polled to retrieve the asynchronous operation's result.protected class
AbstractAsynchronousOperationHandlers.TriggerHandler<T extends RestfulGateway,B extends RequestBody,M extends MessageParameters>
Handler which is responsible for triggering an asynchronous operation.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractAsynchronousOperationHandlers(Duration cacheDuration)
-
-
-
Constructor Detail
-
AbstractAsynchronousOperationHandlers
protected AbstractAsynchronousOperationHandlers(Duration cacheDuration)
-
-