Interface CheckpointProgress

  • All Known Implementing Classes:
    CheckpointProgressImpl

    public interface CheckpointProgress
    Represents information of a progress of a current checkpoint and allows to obtain future to wait for a particular checkpoint state.
    • Method Detail

      • reason

        @Nullable
        @Nullable String reason()
        Returns:
        Description of the reason of the current checkpoint.
      • inProgress

        boolean inProgress()
        Returns:
        true if the current checkpoint is in CheckpointState which shows that checkpoint has already started but not finished yet.
      • futureFor

        GridFutureAdapter futureFor​(CheckpointState state)
        Returns:
        The future which can be used for detection when current checkpoint reaches the specific state.
      • fail

        void fail​(Throwable error)
        Mark this checkpoint execution as failed.
        Parameters:
        error - Causal error of fail.
      • transitTo

        void transitTo​(@NotNull
                       @NotNull CheckpointState newState)
        Changing checkpoint state if order of state is correct.
        Parameters:
        newState - New checkpoint state.
      • writtenPagesCounter

        AtomicInteger writtenPagesCounter()
        Returns:
        Counter for written checkpoint pages. Not null only if checkpoint is running.
      • syncedPagesCounter

        AtomicInteger syncedPagesCounter()
        Returns:
        Counter for fsynced checkpoint pages. Not null only if checkpoint is running.
      • evictedPagesCounter

        AtomicInteger evictedPagesCounter()
        Returns:
        Counter for evicted pages during current checkpoint. Not null only if checkpoint is running.
      • currentCheckpointPagesCount

        int currentCheckpointPagesCount()
        Returns:
        Number of pages in current checkpoint. If checkpoint is not running, returns 0.
      • currentCheckpointPagesCount

        void currentCheckpointPagesCount​(int num)
        Sets current checkpoint pages num to store.
        Parameters:
        num - Pages to store.
      • initCounters

        void initCounters​(int pagesSize)
        Initialize all counters before checkpoint.
      • updateSyncedPages

        void updateSyncedPages​(int delta)
        Update synced pages in checkpoint;
        Parameters:
        delta - Pages num to update.
      • updateWrittenPages

        void updateWrittenPages​(int delta)
        Update written pages in checkpoint;
        Parameters:
        delta - Pages num to update.
      • updateEvictedPages

        void updateEvictedPages​(int delta)
        Update evicted pages in checkpoint;
        Parameters:
        delta - Pages num to update.
      • clearCounters

        void clearCounters()
        Clear cp progress counters.
      • onStateChanged

        void onStateChanged​(CheckpointState state,
                            Runnable clo)
        Invokes a callback closure then a checkpoint reaches specific state. The closure will not be called if an error has happened while transitting to the state.
        Parameters:
        state - State.
        clo - Closure to call.