Class AbstractAsynchronousOperationHandlers<K extends OperationKey,​R extends Serializable>

  • Type Parameters:
    K - type of the operation key under which the result future is stored
    R - 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 registered url. 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 to url/: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"
         }
     }
     
    • Constructor Detail

      • AbstractAsynchronousOperationHandlers

        protected AbstractAsynchronousOperationHandlers​(Duration cacheDuration)