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

## Class CachePartitionDefragmentationManager

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.defragmentation.CachePartitionDefragmentationManager

    public class CachePartitionDefragmentationManager
    extends Object

Defragmentation manager is the core class that contains main defragmentation procedure.

### Field Summary

Fields
`static String` `DEFRAGMENTATION_MNTC_TASK_NAME`

### Constructor Summary

Constructors
Constructor and Description
`CachePartitionDefragmentationManager(List<String> cacheNames, GridCacheSharedContext<?,?> sharedCtx, GridCacheDatabaseSharedManager dbMgr, FilePageStoreManager filePageStoreMgr, CheckpointManager nodeCheckpoint, LightweightCheckpointManager defragmentationCheckpoint, int pageSize, int defragmentationThreadPoolSize)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `beforeDefragmentation()`
`boolean` `cancel()` Cancel the process of defragmentation.
`IgniteInternalFuture<?>` `completionFuture()`
`void` `createIndexPageStore(int grpId, File workDir, FileVersionCheckingFactory pageStoreFactory, DataRegion partRegion, LongConsumer allocatedTracker)`
`void` `executeDefragmentation()`
`org.apache.ignite.internal.processors.cache.persistence.defragmentation.CachePartitionDefragmentationManager.Status` `status()`

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

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

### Field Detail

#### DEFRAGMENTATION_MNTC_TASK_NAME

    public static final String DEFRAGMENTATION_MNTC_TASK_NAME

See Also:
  Constant Field Values

### Constructor Detail

#### CachePartitionDefragmentationManager

    public CachePartitionDefragmentationManager(List<String> cacheNames,
                                                GridCacheSharedContext<?,?> sharedCtx,
                                                GridCacheDatabaseSharedManager dbMgr,
                                                FilePageStoreManager filePageStoreMgr,
                                                CheckpointManager nodeCheckpoint,
                                                LightweightCheckpointManager defragmentationCheckpoint,
                                                int pageSize,
                                                int defragmentationThreadPoolSize)
                                         throws IgniteCheckedException

Parameters:
  `cacheNames` - Names of caches to be defragmented. Empty means "all".
  `sharedCtx` - Cache shared context.
  `dbMgr` - Database manager.
  `filePageStoreMgr` - File page store manager.
  `nodeCheckpoint` - Default checkpoint for this node.
  `defragmentationCheckpoint` - Specific checkpoint for defragmentation.
  `pageSize` - Page size.
Throws:
  `IgniteCheckedException`

### Method Detail

#### beforeDefragmentation

    public void beforeDefragmentation()
                               throws IgniteCheckedException

Throws:
  `IgniteCheckedException`

#### executeDefragmentation

    public void executeDefragmentation()
                                throws IgniteCheckedException

Throws:
  `IgniteCheckedException`

#### completionFuture

    public IgniteInternalFuture<?> completionFuture()

#### createIndexPageStore

    public void createIndexPageStore(int grpId,
                                     File workDir,
                                     FileVersionCheckingFactory pageStoreFactory,
                                     DataRegion partRegion,
                                     LongConsumer allocatedTracker)
                              throws IgniteCheckedException

Throws:
  `IgniteCheckedException`

#### cancel

    public boolean cancel()

Cancel the process of defragmentation.

Returns:
  `true` if process was cancelled by this method.

#### status

    public org.apache.ignite.internal.processors.cache.persistence.defragmentation.CachePartitionDefragmentationManager.Status status()

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022