Package org.apache.ignite.internal.processors.cache.persistence.checkpoint

## Class CheckpointProgressImpl

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgressImpl

All Implemented Interfaces:
  `CheckpointProgress`

    public class CheckpointProgressImpl
    extends Object
    implements CheckpointProgress

Data class representing the state of running/scheduled checkpoint.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `clearCounters()` Clear cp progress counters.
`int` `currentCheckpointPagesCount()`
`void` `currentCheckpointPagesCount​(int num)` Sets current checkpoint pages num to store.
`AtomicInteger` `evictedPagesCounter()`
`void` `fail​(Throwable error)` Mark this checkpoint execution as failed.
`GridFutureAdapter` `futureFor​(CheckpointState state)`
`PartitionDestroyQueue` `getDestroyQueue()`
`boolean` `greaterOrEqualTo​(CheckpointState expectedState)`
`void` `initCounters​(int pagesSize)` Initialize all counters before checkpoint.
`boolean` `inProgress()`
`long` `nextCpNanos()`
`void` `nextCpNanos​(long nextCpNanos)`
`void` `onStateChanged​(CheckpointState state, Runnable clo)` Invokes a callback closure then a checkpoint reaches specific state.
`String` `reason()`
`void` `reason​(String reason)`
`AtomicInteger` `syncedPagesCounter()`
`void` `transitTo​(@NotNull CheckpointState newState)` Changing checkpoint state if order of state is correct.
`void` `updateEvictedPages​(int delta)` Update evicted pages in checkpoint;
`void` `updateSyncedPages​(int deltha)` Update synced pages in checkpoint;
`void` `updateWrittenPages​(int deltha)` Update written pages in checkpoint;
`AtomicInteger` `writtenPagesCounter()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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.

#### futureFor

    public GridFutureAdapter futureFor​(CheckpointState state)

Specified by:
  `futureFor` in interface `CheckpointProgress`
Parameters:
  `state` - State for which future should be returned.
Returns:
  Existed or new future which corresponds to the 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.

#### getDestroyQueue

    public PartitionDestroyQueue getDestroyQueue()

Specified by:
  `getDestroyQueue` in interface `CheckpointProgress`
Returns:
  Destroy queue.

#### 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.

#### writtenPagesCounter

    public AtomicInteger writtenPagesCounter()

Specified by:
  `writtenPagesCounter` in interface `CheckpointProgress`
Returns:
  Counter for written checkpoint pages. Not `null` only if checkpoint is running.

#### updateWrittenPages

    public void updateWrittenPages​(int deltha)

Update written pages in checkpoint;

Specified by:
  `updateWrittenPages` in interface `CheckpointProgress`
Parameters:
  `deltha` - Pages num to update.

#### syncedPagesCounter

    public AtomicInteger syncedPagesCounter()

Specified by:
  `syncedPagesCounter` in interface `CheckpointProgress`
Returns:
  Counter for fsynced checkpoint pages. Not `null` only if checkpoint is running.

#### updateSyncedPages

    public void updateSyncedPages​(int deltha)

Update synced pages in checkpoint;

Specified by:
  `updateSyncedPages` in interface `CheckpointProgress`
Parameters:
  `deltha` - Pages num to update.

#### evictedPagesCounter

    public AtomicInteger evictedPagesCounter()

Specified by:
  `evictedPagesCounter` in interface `CheckpointProgress`
Returns:
  Counter for evicted pages during current checkpoint. Not `null` only if checkpoint is running.

#### 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`

#### clearCounters

    public void clearCounters()

Clear cp progress counters.

Specified by:
  `clearCounters` 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.