Class TaskLocalStateStoreImpl

    • Field Detail

      • jobID

        @Nonnull
        protected final org.apache.flink.api.common.JobID jobID
        JobID from the owning subtask.
      • jobVertexID

        @Nonnull
        protected final JobVertexID jobVertexID
        JobVertexID of the owning subtask.
      • subtaskIndex

        @Nonnegative
        protected final int subtaskIndex
        Subtask index of the owning subtask.
      • discardExecutor

        @Nonnull
        protected final Executor discardExecutor
        Executor that runs the discarding of released state objects.
      • lock

        @Nonnull
        protected final Object lock
        Lock for synchronisation on the storage map and the discarded status.
      • disposed

        protected boolean disposed
        Status flag if this store was already discarded.
    • Method Detail

      • getCheckpointDirectory

        protected File getCheckpointDirectory​(long checkpointId)
      • retrieveLocalState

        @Nullable
        public TaskStateSnapshot retrieveLocalState​(long checkpointID)
        Description copied from interface: TaskLocalStateStore
        Returns the local state that is stored under the given checkpoint id or null if nothing was stored under the id.
        Specified by:
        retrieveLocalState in interface TaskLocalStateStore
        Parameters:
        checkpointID - the checkpoint id by which we search for local state.
        Returns:
        the local state found for the given checkpoint id. Can be null
      • confirmCheckpoint

        public void confirmCheckpoint​(long confirmedCheckpointId)
        Description copied from interface: TaskLocalStateStore
        Notifies that the checkpoint with the given id was confirmed as complete. This prunes the checkpoint history and removes all local states with a checkpoint id that is smaller than the newly confirmed checkpoint id.
        Specified by:
        confirmCheckpoint in interface TaskLocalStateStore
      • abortCheckpoint

        public void abortCheckpoint​(long abortedCheckpointId)
        Description copied from interface: TaskLocalStateStore
        Notifies that the checkpoint with the given id was confirmed as aborted. This prunes the checkpoint history and removes states with a checkpoint id that is equal to the newly aborted checkpoint id.
        Specified by:
        abortCheckpoint in interface TaskLocalStateStore
      • pruneMatchingCheckpoints

        public void pruneMatchingCheckpoints​(@Nonnull
                                             java.util.function.LongPredicate matcher)
        Description copied from interface: TaskLocalStateStore
        Remove all checkpoints from the store that match the given predicate.
        Specified by:
        pruneMatchingCheckpoints in interface TaskLocalStateStore
        Parameters:
        matcher - the predicate that selects the checkpoints for pruning.
      • deleteDirectory

        protected void deleteDirectory​(File directory)
                                throws IOException
        Helper method to delete a directory.
        Throws:
        IOException
      • pruneCheckpoints

        protected void pruneCheckpoints​(java.util.function.LongPredicate pruningChecker,
                                        boolean breakOnceCheckerFalse)
        Pruning the useless checkpoints, it should be called only when holding the lock.