Class CheckpointProgressImpl

    • Method Detail

      • inProgress

        public boolean inProgress()
        Specified by:
        inProgress in interface CheckpointProgress
        Returns:
        true If checkpoint already started but have not finished yet.
      • greaterOrEqualTo

        public boolean greaterOrEqualTo​(CheckpointState expectedState)
        Parameters:
        expectedState - Expected state.
        Returns:
        true if current state equal to given state.
      • fail

        public void fail​(Throwable error)
        Mark this checkpoint execution as failed.
        Specified by:
        fail in interface CheckpointProgress
        Parameters:
        error - Causal error of fail.
      • transitTo

        public void transitTo​(@NotNull
                              @NotNull CheckpointState newState)
        Changing checkpoint state if order of state is correct.
        Specified by:
        transitTo in interface CheckpointProgress
        Parameters:
        newState - New checkpoint state.
      • nextCpNanos

        public long nextCpNanos()
        Returns:
        Scheduled time of checkpoint.
      • nextCpNanos

        public void nextCpNanos​(long nextCpNanos)
        Parameters:
        nextCpNanos - New scheduled time of checkpoint.
      • reason

        public String reason()
        Specified by:
        reason in interface CheckpointProgress
        Returns:
        Description of the reason of the current checkpoint.
      • reason

        public void reason​(String reason)
        Parameters:
        reason - New wakeup reason.
      • updateWrittenPages

        public void updateWrittenPages​(int deltha)
        Update written pages in checkpoint;
        Specified by:
        updateWrittenPages in interface CheckpointProgress
        Parameters:
        deltha - Pages num to update.
      • updateSyncedPages

        public void updateSyncedPages​(int deltha)
        Update synced pages in checkpoint;
        Specified by:
        updateSyncedPages in interface CheckpointProgress
        Parameters:
        deltha - Pages num to update.
      • updateEvictedPages

        public void updateEvictedPages​(int delta)
        Update evicted pages in checkpoint;
        Specified by:
        updateEvictedPages in interface CheckpointProgress
        Parameters:
        delta - Pages num to update.
      • currentCheckpointPagesCount

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

        public void currentCheckpointPagesCount​(int num)
        Sets current checkpoint pages num to store.
        Specified by:
        currentCheckpointPagesCount in interface CheckpointProgress
        Parameters:
        num - Pages to store.
      • initCounters

        public void initCounters​(int pagesSize)
        Initialize all counters before checkpoint.
        Specified by:
        initCounters in interface CheckpointProgress
      • onStateChanged

        public 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.
        Specified by:
        onStateChanged in interface CheckpointProgress
        Parameters:
        state - State.
        clo - Closure to call.