Class SnapshotPartitionsVerifyHandler
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsVerifyHandler
-
- All Implemented Interfaces:
SnapshotHandler<Map<PartitionKeyV2,PartitionHashRecordV2>>,Extension
- Direct Known Subclasses:
SnapshotPartitionsQuickVerifyHandler
public class SnapshotPartitionsVerifyHandler extends Object implements SnapshotHandler<Map<PartitionKeyV2,PartitionHashRecordV2>>
Default snapshot restore handler for checking snapshot partitions consistency.
-
-
Field Summary
Fields Modifier and Type Field Description protected GridCacheSharedContext<?,?>cctxShared context.
-
Constructor Summary
Constructors Constructor Description SnapshotPartitionsVerifyHandler(GridCacheSharedContext<?,?> cctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete(String name, Collection<SnapshotHandlerResult<Map<PartitionKeyV2,PartitionHashRecordV2>>> results)Processing the results of theSnapshotHandler.invoke(SnapshotHandlerContext)method received from all nodes.Map<PartitionKeyV2,PartitionHashRecordV2>invoke(SnapshotHandlerContext opCtx)Local processing of a snapshot operation.protected booleanisPunchHoleEnabled(SnapshotHandlerContext opCtx, Set<Integer> grpIds)protected booleanskipHash()Provides flag of full hash calculation.SnapshotHandlerTypetype()Snapshot handler type.
-
-
-
Field Detail
-
cctx
protected final GridCacheSharedContext<?,?> cctx
Shared context.
-
-
Constructor Detail
-
SnapshotPartitionsVerifyHandler
public SnapshotPartitionsVerifyHandler(GridCacheSharedContext<?,?> cctx)
- Parameters:
cctx- Shared context.
-
-
Method Detail
-
type
public SnapshotHandlerType type()
Snapshot handler type.- Specified by:
typein interfaceSnapshotHandler<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:
invokein interfaceSnapshotHandler<Map<PartitionKeyV2,PartitionHashRecordV2>>- Parameters:
opCtx- Snapshot handler context.- Returns:
- Result of local processing. This result will be returned in
SnapshotHandlerResult.data()method passed intoSnapshotHandler.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 theSnapshotHandler.invoke(SnapshotHandlerContext)method received from all nodes. This method is called on coordinator node forSnapshotHandlerType.CREATEhandler type and on the random node containing the snapshot data forSnapshotHandlerType.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:
completein interfaceSnapshotHandler<Map<PartitionKeyV2,PartitionHashRecordV2>>- Parameters:
name- Snapshot name.results- Results from all nodes.- Throws:
SnapshotWarningException- If a warning of snapshot operation occurred.IgniteCheckedException- See Also:
SnapshotHandlerResult
-
skipHash
protected boolean skipHash()
Provides flag of full hash calculation.- Returns:
Trueif full partition hash calculation is required.Falseotherwise.
-
isPunchHoleEnabled
protected boolean isPunchHoleEnabled(SnapshotHandlerContext opCtx, Set<Integer> grpIds)
-
-