Search in sources :

Example 1 with UnexpectedStoreVersionException

use of org.neo4j.kernel.impl.store.UnexpectedStoreVersionException in project neo4j by neo4j.

the class BackupTool method executeBackup.

BackupOutcome executeBackup(HostnamePort hostnamePort, File to, ConsistencyCheck consistencyCheck, Config config, long timeout, boolean forensics) throws ToolFailureException {
    try {
        systemOut.println("Performing backup from '" + hostnamePort + "'");
        String host = hostnamePort.getHost();
        int port = hostnamePort.getPort();
        BackupOutcome outcome = backupService.doIncrementalBackupOrFallbackToFull(host, port, to, consistencyCheck, config, timeout, forensics);
        systemOut.println("Done");
        return outcome;
    } catch (UnexpectedStoreVersionException e) {
        throw new ToolFailureException(e.getMessage(), e);
    } catch (MismatchingStoreIdException e) {
        throw new ToolFailureException(String.format(MISMATCHED_STORE_ID, e.getExpected(), e.getEncountered()));
    } catch (ComException e) {
        throw new ToolFailureException("Couldn't connect to '" + hostnamePort + "'", e);
    } catch (IncrementalBackupNotPossibleException e) {
        throw new ToolFailureException(e.getMessage(), e);
    }
}
Also used : ComException(org.neo4j.com.ComException) UnexpectedStoreVersionException(org.neo4j.kernel.impl.store.UnexpectedStoreVersionException) BackupOutcome(org.neo4j.backup.BackupService.BackupOutcome) MismatchingStoreIdException(org.neo4j.kernel.impl.store.MismatchingStoreIdException)

Aggregations

BackupOutcome (org.neo4j.backup.BackupService.BackupOutcome)1 ComException (org.neo4j.com.ComException)1 MismatchingStoreIdException (org.neo4j.kernel.impl.store.MismatchingStoreIdException)1 UnexpectedStoreVersionException (org.neo4j.kernel.impl.store.UnexpectedStoreVersionException)1