org.apache.ignite.internal.processors.cache.persistence.snapshot

## Class SnapshotPartitionsVerifyHandler

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsVerifyHandler

All Implemented Interfaces:
  SnapshotHandler<Map<PartitionKeyV2,PartitionHashRecordV2>>, Extension

    public class SnapshotPartitionsVerifyHandler
    extends Object
    implements SnapshotHandler<Map<PartitionKeyV2,PartitionHashRecordV2>>

Default snapshot restore handler for checking snapshot partitions consistency.

### Constructor Summary

Constructors
Constructor and Description
`SnapshotPartitionsVerifyHandler(GridCacheSharedContext<?,?> cctx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `complete(String name, Collection<SnapshotHandlerResult<Map<PartitionKeyV2,PartitionHashRecordV2>>> results)` Processing the results of the `SnapshotHandler.invoke(SnapshotHandlerContext)` method received from all nodes.
`Map<PartitionKeyV2,PartitionHashRecordV2>` `invoke(SnapshotHandlerContext opCtx)` Local processing of a snapshot operation.
`SnapshotHandlerType` `type()` Snapshot handler type.

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

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

### Constructor Detail

#### SnapshotPartitionsVerifyHandler

    public SnapshotPartitionsVerifyHandler(GridCacheSharedContext<?,?> cctx)

Parameters:
  `cctx` - Shared context.

### Method Detail

#### type

    public SnapshotHandlerType type()

Snapshot handler type.

Specified by:
  `type` in interface `SnapshotHandler<Map<PartitionKeyV2,PartitionHashRecordV2>>`

#### invoke

    public Map<PartitionKeyV2,PartitionHashRecordV2> invoke(SnapshotHandlerContext opCtx)
                                                     throws IgniteCheckedException

Local processing of a snapshot operation. Called on every node that contains snapshot data.

Specified by:
  `invoke` in interface `SnapshotHandler<Map<PartitionKeyV2,PartitionHashRecordV2>>`
Parameters:
  `opCtx` - Snapshot handler context.
Returns:
  Result of local processing. This result will be returned in `SnapshotHandlerResult.data()` method passed into `SnapshotHandler.complete(String, Collection)` handler method.
Throws:
  `IgniteCheckedException`

#### complete

    public void complete(String name,
                         Collection<SnapshotHandlerResult<Map<PartitionKeyV2,PartitionHashRecordV2>>> results)
                  throws IgniteCheckedException

Processing the results of the `SnapshotHandler.invoke(SnapshotHandlerContext)` method received from all nodes. This method is called on coordinator node for `SnapshotHandlerType.CREATE` handler type and on the random node containing the snapshot data for `SnapshotHandlerType.RESTORE`.

Note: If this method fails, the entire cluster-wide snapshot operation will be aborted and the changes made by it will be rolled back.

Specified by:
  `complete` in interface `SnapshotHandler<Map<PartitionKeyV2,PartitionHashRecordV2>>`
Parameters:
  `name` - Snapshot name.
  `results` - Results from all nodes.
Throws:
  `IgniteCheckedException`
See Also:
  `SnapshotHandlerResult`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022