Class SavepointHandlers


  • public class SavepointHandlers
    extends Object
    HTTP handlers for asynchronous triggering of savepoints.

    Drawing savepoints is a potentially long-running operation. To avoid blocking HTTP connections, savepoints must be drawn in two steps. First, an HTTP request is issued to trigger the savepoint asynchronously. The request will be assigned a TriggerId, which is returned in the response body. Next, the returned id should be used to poll the status of the savepoint until it is finished.

    A savepoint is triggered by sending an HTTP POST request to /jobs/:jobid/savepoints. The HTTP request may contain a JSON body to specify the target directory of the savepoint, e.g.,

     { "target-directory": "/tmp" }
     

    If the body is omitted, or the field target-property is null, the default savepoint directory as specified by CheckpointingOptions.SAVEPOINT_DIRECTORY will be used. As written above, the response will contain a request id, e.g.,

     { "request-id": "7d273f5a62eb4730b9dea8e833733c1e" }
     

    To poll for the status of an ongoing savepoint, an HTTP GET request is issued to /jobs/:jobid/savepoints/:savepointtriggerid. If the specified savepoint is still ongoing, the response will be

     {
         "status": {
             "id": "IN_PROGRESS"
         }
     }
     

    If the specified savepoint has completed, the status id will transition to COMPLETED, and the response will additionally contain information about the savepoint, such as the location:

     {
         "status": {
             "id": "COMPLETED"
         },
         "operation": {
             "location": "/tmp/savepoint-d9813b-8a68e674325b"
         }
     }
     
    • Constructor Detail

      • SavepointHandlers

        public SavepointHandlers​(@Nullable
                                 String defaultSavepointDir)