Class CacheGroupPageScanner
- java.lang.Object
-
- org.apache.ignite.internal.managers.encryption.CacheGroupPageScanner
-
- All Implemented Interfaces:
CheckpointListener
public class CacheGroupPageScanner extends Object implements CheckpointListener
Cache group page stores scanner. Scans a range of pages and marks them as dirty to re-encrypt them with the last encryption key on disk.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointListener
CheckpointListener.Context
-
-
Constructor Summary
Constructors Constructor Description CacheGroupPageScanner(GridKernalContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeCheckpointBegin(CheckpointListener.Context cpCtx)Do some actions before checkpoint write lock.booleanexcludePartition(int grpId, int partId)Stop scannig the specified partition.doublegetRate()voidincludePartition(int grpId, int partId)voidonCheckpointBegin(CheckpointListener.Context cpCtx)voidonMarkCheckpointBegin(CheckpointListener.Context ctx)long[]pagesCount(CacheGroupContext grp)Collect current number of pages in the specified cache group.longremainingPagesCount(int grpId)IgniteInternalFuture<Void>schedule(int grpId)Schedule scanning partitions.voidsetRate(double rate)IgniteInternalFuture<Void>statusFuture(int grpId)voidstop()Shutdown scanning and disable new tasks scheduling.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointListener
afterCheckpointEnd
-
-
-
-
Constructor Detail
-
CacheGroupPageScanner
public CacheGroupPageScanner(GridKernalContext ctx)
- Parameters:
ctx- Grid kernal context.
-
-
Method Detail
-
onCheckpointBegin
public void onCheckpointBegin(CheckpointListener.Context cpCtx)
- Specified by:
onCheckpointBeginin interfaceCheckpointListener
-
beforeCheckpointBegin
public void beforeCheckpointBegin(CheckpointListener.Context cpCtx)
Do some actions before checkpoint write lock.- Specified by:
beforeCheckpointBeginin interfaceCheckpointListener
-
onMarkCheckpointBegin
public void onMarkCheckpointBegin(CheckpointListener.Context ctx)
- Specified by:
onMarkCheckpointBeginin interfaceCheckpointListener
-
schedule
public IgniteInternalFuture<Void> schedule(int grpId) throws IgniteCheckedException
Schedule scanning partitions.- Parameters:
grpId- Cache group ID.- Throws:
IgniteCheckedException
-
statusFuture
public IgniteInternalFuture<Void> statusFuture(int grpId)
- Parameters:
grpId- Cache group ID.- Returns:
- Future that will be completed when all partitions have been scanned and pages have been written to disk.
-
stop
public void stop() throws IgniteCheckedExceptionShutdown scanning and disable new tasks scheduling.- Throws:
IgniteCheckedException
-
excludePartition
public boolean excludePartition(int grpId, int partId)Stop scannig the specified partition.- Parameters:
grpId- Cache group ID.partId- Partition ID.- Returns:
Trueif reencryption was cancelled.
-
includePartition
public void includePartition(int grpId, int partId)- Parameters:
grpId- Cache group ID.partId- Partition ID.
-
pagesCount
public long[] pagesCount(CacheGroupContext grp) throws IgniteCheckedException
Collect current number of pages in the specified cache group.- Parameters:
grp- Cache group.- Returns:
- Partitions with current page count.
- Throws:
IgniteCheckedException- If failed.
-
remainingPagesCount
public long remainingPagesCount(int grpId)
- Parameters:
grpId- Cache group ID.- Returns:
- Number of remaining memory pages to scan.
-
getRate
public double getRate()
- Returns:
- Re-encryption rate limit in megabytes per second (
0- unlimited).
-
setRate
public void setRate(double rate)
- Parameters:
rate- Re-encryption rate limit in megabytes per second (0- unlimited).
-
-