use of org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.CORRUPTED_DATA_FILES_MNTC_TASK_NAME in project ignite by apache.
the class WalEnableDisableWithNodeShutdownTest method startNodeWithMaintenance.
/**
*/
private Ignite startNodeWithMaintenance(String consistentId) throws Exception {
Ignite node;
try {
node = Ignition.start(igniteCfg(false, consistentId));
} catch (Exception ex) {
assertTrue(X.hasCause(ex, "Cache groups with potentially corrupted partition files", IgniteException.class));
node = Ignition.start(igniteCfg(false, consistentId));
node.compute().run(new IgniteRunnable() {
/**
*/
@IgniteInstanceResource
private Ignite ignite;
/**
*/
@Override
public void run() {
MaintenanceRegistry mntcRegistry = ((IgniteEx) ignite).context().maintenanceRegistry();
List<MaintenanceAction<?>> actions = mntcRegistry.actionsForMaintenanceTask(CORRUPTED_DATA_FILES_MNTC_TASK_NAME);
actions.stream().filter(a -> a.name().equals(CleanCacheStoresMaintenanceAction.ACTION_NAME)).findFirst().get().execute();
mntcRegistry.unregisterMaintenanceTask(CORRUPTED_DATA_FILES_MNTC_TASK_NAME);
}
});
node.close();
node = Ignition.start(igniteCfg(false, consistentId));
}
return node;
}
use of org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.CORRUPTED_DATA_FILES_MNTC_TASK_NAME in project ignite by apache.
the class WalEnableDisableWithRestartsTest method startNodeWithMaintenance.
/**
*/
private Ignite startNodeWithMaintenance(String consistentId) throws Exception {
Ignite node;
try {
node = Ignition.start(igniteCfg(false, consistentId));
} catch (Exception ex) {
if (!X.hasCause(ex, "Cache groups with potentially corrupted partition files", IgniteException.class))
throw ex;
node = Ignition.start(igniteCfg(false, consistentId));
node.compute().run(new IgniteRunnable() {
/**
*/
@IgniteInstanceResource
private Ignite ignite;
/**
*/
@Override
public void run() {
MaintenanceRegistry mntcRegistry = ((IgniteEx) ignite).context().maintenanceRegistry();
List<MaintenanceAction<?>> actions = mntcRegistry.actionsForMaintenanceTask(CORRUPTED_DATA_FILES_MNTC_TASK_NAME);
actions.stream().filter(a -> a.name().equals(CleanCacheStoresMaintenanceAction.ACTION_NAME)).findFirst().get().execute();
mntcRegistry.unregisterMaintenanceTask(CORRUPTED_DATA_FILES_MNTC_TASK_NAME);
}
});
node.close();
node = Ignition.start(igniteCfg(false, consistentId));
}
return node;
}
Aggregations