use of org.apache.ignite.internal.processors.cache.persistence.defragmentation.maintenance.DefragmentationWorkflowCallback in project ignite by apache.
the class GridCacheDatabaseSharedManager method readMetastore.
/**
*/
private void readMetastore() throws IgniteCheckedException {
try {
CheckpointStatus status = readCheckpointStatus();
checkpointReadLock();
try {
dataRegion(METASTORE_DATA_REGION_NAME).pageMemory().start();
performBinaryMemoryRestore(status, onlyMetastorageGroup(), physicalRecords(), false);
metaStorage = createMetastorage(true);
applyLogicalUpdates(status, onlyMetastorageGroup(), onlyMetastorageAndEncryptionRecords(), true);
fillWalDisabledGroups();
checkpointManager.initializeStorage();
registerSystemView();
notifyMetastorageReadyForRead();
cctx.kernalContext().maintenanceRegistry().registerWorkflowCallbackIfTaskExists(DEFRAGMENTATION_MNTC_TASK_NAME, task -> {
prepareCacheDefragmentation(fromStore(task).cacheNames());
return new DefragmentationWorkflowCallback(cctx.kernalContext()::log, defrgMgr, cctx.kernalContext().failure());
});
} finally {
if (metaStorage != null)
metaStorage.close();
metaStorage = null;
dataRegion(METASTORE_DATA_REGION_NAME).pageMemory().stop(false);
cctx.pageStore().cleanupPageStoreIfMatch(new Predicate<Integer>() {
@Override
public boolean test(Integer grpId) {
return MetaStorage.METASTORAGE_CACHE_ID == grpId;
}
}, false);
checkpointReadUnlock();
}
} catch (StorageException e) {
cctx.kernalContext().failure().process(new FailureContext(FailureType.CRITICAL_ERROR, e));
throw new IgniteCheckedException(e);
}
}
Aggregations