Interface SnapshotStrategy<S extends StateObject,​SR extends SnapshotResources>

    • Method Detail

      • syncPrepareResources

        SR syncPrepareResources​(long checkpointId)
                         throws Exception
        Performs the synchronous part of the snapshot. It returns resources which can be later on used in the asynchronous part.
        Parameters:
        checkpointId - The ID of the checkpoint.
        Returns:
        Resources needed to finish the snapshot.
        Throws:
        Exception
      • asyncSnapshot

        SnapshotStrategy.SnapshotResultSupplier<S> asyncSnapshot​(SR syncPartResource,
                                                                 long checkpointId,
                                                                 long timestamp,
                                                                 @Nonnull
                                                                 CheckpointStreamFactory streamFactory,
                                                                 @Nonnull
                                                                 CheckpointOptions checkpointOptions)
        Operation that writes a snapshot into a stream that is provided by the given CheckpointStreamFactory and returns a @SupplierWithException that gives a state handle to the snapshot.
        Parameters:
        checkpointId - The ID of the checkpoint.
        timestamp - The timestamp of the checkpoint.
        streamFactory - The factory that we can use for writing our state to streams.
        checkpointOptions - Options for how to perform this checkpoint.
        Returns:
        A supplier that will yield a StateObject.