private void assertRecovered( DatabaseLayout databaseLayout, Config config, FileSystemAbstraction fileSystem, PageCache pageCache ) throws ConsistencyCheckIncompleteException { try { assertRecoveryIsNotRequired( fileSystem, pageCache, config, databaseLayout, new Monitors() ); } catch ( RecoveryRequiredException | IOException e ) { throw new ConsistencyCheckIncompleteException( e ); } }
private void checkDbState( DatabaseLayout databaseLayout, Config tuningConfiguration ) throws ToolFailureException { try ( JobScheduler jobScheduler = createInitialisedScheduler(); PageCache pageCache = ConfigurableStandalonePageCacheFactory.createPageCache( fs, tuningConfiguration, jobScheduler ) ) { assertRecoveryIsNotRequired( fs, pageCache, tuningConfiguration, databaseLayout, new Monitors() ); } catch ( RecoveryRequiredException rre ) { throw new ToolFailureException( rre.getMessage() ); } catch ( Exception e ) { systemError.printf( "Failure when checking for recovery state: '%s', continuing as normal.%n", e ); } }
private static void checkDbState( DatabaseLayout databaseLayout, Config additionalConfiguration ) throws CommandFailed { try ( FileSystemAbstraction fileSystem = new DefaultFileSystemAbstraction(); JobScheduler jobScheduler = createInitialisedScheduler(); PageCache pageCache = ConfigurableStandalonePageCacheFactory.createPageCache( fileSystem, additionalConfiguration, jobScheduler ) ) { RecoveryRequiredChecker.assertRecoveryIsNotRequired( fileSystem, pageCache, additionalConfiguration, databaseLayout, new Monitors() ); } catch ( RecoveryRequiredException rre ) { throw new CommandFailed( rre.getMessage() ); } catch ( Exception e ) { throw new CommandFailed( "Failure when checking for recovery state: '%s'." + e.getMessage(), e ); } }
private static void checkDbState( DatabaseLayout databaseLayout, Config additionalConfiguration ) throws CommandFailed { try ( FileSystemAbstraction fileSystem = new DefaultFileSystemAbstraction(); JobScheduler jobScheduler = createInitialisedScheduler(); PageCache pageCache = ConfigurableStandalonePageCacheFactory .createPageCache( fileSystem, additionalConfiguration, jobScheduler ) ) { assertRecoveryIsNotRequired( fileSystem, pageCache, additionalConfiguration, databaseLayout, new Monitors() ); } catch ( RecoveryRequiredException rre ) { throw new CommandFailed( rre.getMessage() ); } catch ( Exception e ) { throw new CommandFailed( "Failure when checking for recovery state: '%s'." + e.getMessage(), e ); } }
@Test public void shouldNotThrowIfIntactStore() throws RecoveryRequiredException, IOException { PageCache pageCache = pageCacheRule.getPageCache( fileSystem ); RecoveryRequiredChecker.assertRecoveryIsNotRequired( fileSystem, pageCache, Config.defaults(), databaseLayout, new Monitors() ); }
@Test( expected = RecoveryRequiredException.class ) public void shouldThrowIfBrokenStore() throws IOException, RecoveryRequiredException { try ( FileSystemAbstraction fileSystemAbstraction = createAndCrashWithDefaultConfig() ) { PageCache pageCache = pageCacheRule.getPageCache( fileSystemAbstraction ); RecoveryRequiredChecker.assertRecoveryIsNotRequired( fileSystemAbstraction, pageCache, Config.defaults(), databaseLayout, new Monitors() ); fail(); } }
private static void checkDbState( DatabaseLayout databaseLayout, Config additionalConfiguration ) throws CommandFailed { try ( FileSystemAbstraction fileSystem = new DefaultFileSystemAbstraction(); JobScheduler jobScheduler = createInitialisedScheduler(); PageCache pageCache = ConfigurableStandalonePageCacheFactory.createPageCache( fileSystem, additionalConfiguration, jobScheduler ) ) { RecoveryRequiredChecker.assertRecoveryIsNotRequired( fileSystem, pageCache, additionalConfiguration, databaseLayout, new Monitors() ); } catch ( RecoveryRequiredException rre ) { throw new CommandFailed( rre.getMessage() ); } catch ( Exception e ) { throw new CommandFailed( "Failure when checking for recovery state: '%s'." + e.getMessage(), e ); } }