Search in sources :

Example 1 with CachePartitionDefragmentationManager

use of org.apache.ignite.internal.processors.cache.persistence.defragmentation.CachePartitionDefragmentationManager in project ignite by apache.

the class GridCacheDatabaseSharedManager method prepareCacheDefragmentation.

/**
 */
private void prepareCacheDefragmentation(List<String> cacheNames) throws IgniteCheckedException {
    GridKernalContext kernalCtx = cctx.kernalContext();
    DataStorageConfiguration dsCfg = kernalCtx.config().getDataStorageConfiguration();
    assert CU.isPersistenceEnabled(dsCfg);
    List<DataRegion> regions = Arrays.asList(dataRegion(DEFRAGMENTATION_MAPPING_REGION_NAME), dataRegion(DEFRAGMENTATION_PART_REGION_NAME));
    LightweightCheckpointManager lightCheckpointMgr = new LightweightCheckpointManager(kernalCtx::log, cctx.igniteInstanceName(), "db-checkpoint-thread-defrag", kernalCtx.workersRegistry(), persistenceCfg, () -> regions, this::getPageMemoryForCacheGroup, resolveThrottlingPolicy(), snapshotMgr, persistentStoreMetricsImpl(), kernalCtx.longJvmPauseDetector(), kernalCtx.failure(), kernalCtx.cache());
    lightCheckpointMgr.start();
    defrgMgr = new CachePartitionDefragmentationManager(cacheNames, cctx, this, (FilePageStoreManager) cctx.pageStore(), checkpointManager, lightCheckpointMgr, persistenceCfg.getPageSize(), persistenceCfg.getDefragmentationThreadPoolSize());
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) LightweightCheckpointManager(org.apache.ignite.internal.processors.cache.persistence.checkpoint.LightweightCheckpointManager) GridKernalContext(org.apache.ignite.internal.GridKernalContext) FilePageStoreManager(org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager) CachePartitionDefragmentationManager(org.apache.ignite.internal.processors.cache.persistence.defragmentation.CachePartitionDefragmentationManager)

Aggregations

DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)1 GridKernalContext (org.apache.ignite.internal.GridKernalContext)1 LightweightCheckpointManager (org.apache.ignite.internal.processors.cache.persistence.checkpoint.LightweightCheckpointManager)1 CachePartitionDefragmentationManager (org.apache.ignite.internal.processors.cache.persistence.defragmentation.CachePartitionDefragmentationManager)1 FilePageStoreManager (org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager)1