public void restoreAll ( ) throws Exception { if ( ! backupProvider . isPresent ( ) ) { log . info ( "No backup provider configured. Skipping restore." ) ; return ; } ZooKeeperLogFiles logFiles = new ZooKeeperLogFiles ( exhibitor ) ; log . info ( "Restoring log files from backup." ) ; if ( ! logFiles . isValid ( ) ) { log . error ( "Backup path invalid. Skipping restore." ) ; return ; } if ( logFiles . getPaths ( ) . isEmpty ( ) ) { log . info ( "Backup path(s) empty. Skipping restore." ) ; return ; } File dataDir = ZooKeeperLogFiles . getDataDir ( exhibitor ) ; for ( BackupMetaData data : getAvailableBackups ( ) ) { String fileName = data . getName ( ) ; log . info ( String . format ( "Restoring file: %s" , fileName ) ) ; File file = new File ( dataDir , fileName ) ; restore ( data , file ) ; } log . info ( "Restoring logs from backup done." ) ; }
Restore all known logs