org.apache.ignite.internal.processors.localtask

## Class DurableBackgroundTasksProcessor

- java.lang.Object
- - org.apache.ignite.internal.processors.GridProcessorAdapter
  - - org.apache.ignite.internal.processors.localtask.DurableBackgroundTasksProcessor

All Implemented Interfaces:
  GridComponent, DbCheckpointListener, MetastorageLifecycleListener, GridProcessor

    public class DurableBackgroundTasksProcessor
    extends GridProcessorAdapter
    implements MetastorageLifecycleListener, DbCheckpointListener

Processor that is responsible for durable background tasks that are executed on local node and should be continued even after node restart.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.processors.cache.persistence.DbCheckpointListener

`DbCheckpointListener.Context`

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent

`GridComponent.DiscoveryDataExchangeType`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`ctx, diagnosticLog, log`

### Constructor Summary

Constructors
Constructor and Description
`DurableBackgroundTasksProcessor(GridKernalContext ctx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `beforeCheckpointBegin(DbCheckpointListener.Context ctx)` Do some actions before checkpoint write lock.
`void` `onCheckpointBegin(DbCheckpointListener.Context ctx)`
`void` `onKernalStart(boolean active)` Callback that notifies that kernal has successfully started, including all managers and processors.
`void` `onKernalStop(boolean cancel)` Callback to notify that kernal is about to stop.
`void` `onMarkCheckpointBegin(DbCheckpointListener.Context ctx)`
`void` `onReadyForRead(ReadOnlyMetastorage metastorage)` Is called when metastorage is made ready for read-only operations very early on node startup phase.
`void` `onReadyForReadWrite(ReadWriteMetastorage metastorage)` Fully functional metastore capable of performing reading and writing operations.
`void` `onStateChangeFinish(ChangeGlobalStateFinishMessage msg)`
`void` `start()` Starts grid component.
`void` `startDurableBackgroundTask(DurableBackgroundTask task, CacheConfiguration ccfg)` Starts durable background task.

### Methods inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, onDisconnected, onGridDataReceived, onJoiningNodeDataReceived, onReconnected, printMemoryStats, stop, toString, validateNode, validateNode`

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

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

### Constructor Detail

#### DurableBackgroundTasksProcessor

    public DurableBackgroundTasksProcessor(GridKernalContext ctx)

Parameters:
  `ctx` - Kernal context.

### Method Detail

#### onKernalStart

    public void onKernalStart(boolean active)

Callback that notifies that kernal has successfully started, including all managers and processors.

Specified by:
  `onKernalStart` in interface `GridComponent`
Overrides:
  `onKernalStart` in class `GridProcessorAdapter`
Parameters:
  `active` - Cluster active flag (note: should be used carefully since state can change concurrently).

#### onKernalStop

    public void onKernalStop(boolean cancel)

Callback to notify that kernal is about to stop.

Specified by:
  `onKernalStop` in interface `GridComponent`
Overrides:
  `onKernalStop` in class `GridProcessorAdapter`
Parameters:
  `cancel` - Flag indicating whether jobs should be canceled.

#### start

    public void start()
               throws IgniteCheckedException

Starts grid component.

Specified by:
  `start` in interface `GridComponent`
Overrides:
  `start` in class `GridProcessorAdapter`
Throws:
  `IgniteCheckedException` - Throws in case of any errors.

#### onStateChangeFinish

    public void onStateChangeFinish(ChangeGlobalStateFinishMessage msg)

Parameters:
  `msg` - Message.

#### onReadyForRead

    public void onReadyForRead(ReadOnlyMetastorage metastorage)

Is called when metastorage is made ready for read-only operations very early on node startup phase. Reference for read-only metastorage should be used only within this method and shouldn't be stored to any field.

Specified by:
  `onReadyForRead` in interface `MetastorageLifecycleListener`
Parameters:
  `metastorage` - Read-only meta storage.

#### onReadyForReadWrite

    public void onReadyForReadWrite(ReadWriteMetastorage metastorage)

Fully functional metastore capable of performing reading and writing operations. Components interested in using metastore are allowed to keep reference passed into the method in their fields.

Specified by:
  `onReadyForReadWrite` in interface `MetastorageLifecycleListener`
Parameters:
  `metastorage` - Fully functional meta storage.

#### startDurableBackgroundTask

    public void startDurableBackgroundTask(DurableBackgroundTask task,
                                           CacheConfiguration ccfg)

Starts durable background task. If task is applied to persistent cache, saves it to metastorage.

Parameters:
  `task` - Continuous task.
  `ccfg` - Cache configuration.

#### onMarkCheckpointBegin

    public void onMarkCheckpointBegin(DbCheckpointListener.Context ctx)

Specified by:
  `onMarkCheckpointBegin` in interface `DbCheckpointListener`

#### onCheckpointBegin

    public void onCheckpointBegin(DbCheckpointListener.Context ctx)

Specified by:
  `onCheckpointBegin` in interface `DbCheckpointListener`

#### beforeCheckpointBegin

    public void beforeCheckpointBegin(DbCheckpointListener.Context ctx)

Do some actions before checkpoint write lock.

Specified by:
  `beforeCheckpointBegin` in interface `DbCheckpointListener`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020