diff --git a/priam/src/main/java/com/netflix/priam/restore/AbstractRestore.java b/priam/src/main/java/com/netflix/priam/restore/AbstractRestore.java index 1074206e5..49592bac7 100644 --- a/priam/src/main/java/com/netflix/priam/restore/AbstractRestore.java +++ b/priam/src/main/java/com/netflix/priam/restore/AbstractRestore.java @@ -42,7 +42,6 @@ import javax.inject.Named; import javax.inject.Provider; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -218,13 +217,6 @@ public void restore(DateUtil.DateRange dateRange) throws Exception { instanceIdentity.getInstance().setToken(restoreToken.toString()); } - // Stop cassandra if its running - stopCassProcess(); - - // Cleanup local data - File dataDir = new File(config.getDataFileLocation()); - if (dataDir.exists() && dataDir.isDirectory()) FileUtils.cleanDirectory(dataDir); - // Find latest valid meta file. Optional latestValidMetaFile = BackupRestoreUtil.getLatestValidMetaPath(metaProxy, dateRange); @@ -255,7 +247,6 @@ public void restore(DateUtil.DateRange dateRange) throws Exception { List> futureList = new ArrayList<>(); futureList.addAll(download(allFiles.iterator(), false)); - // Downloading CommitLogs // Note for Backup V2.0 we do not backup commit logs, as saving them is cost-expensive. if (config.isBackingUpCommitLogs()) { logger.info( @@ -276,20 +267,9 @@ public void restore(DateUtil.DateRange dateRange) throws Exception { // Wait for all the futures to finish. waitForCompletion(futureList); - // Given that files are restored now, kick off post restore hook - logger.info("Starting post restore hook"); - postRestoreHook.execute(); - logger.info("Completed executing post restore hook"); - // Declare restore as finished. instanceState.getRestoreStatus().setExecutionEndTime(LocalDateTime.now()); instanceState.setRestoreStatus(Status.FINISHED); - - // Start cassandra if restore is successful. - if (!config.doesCassandraStartManually()) cassProcess.start(true); - else - logger.info( - "config.doesCassandraStartManually() is set to True, hence Cassandra needs to be started manually ..."); } catch (Exception e) { instanceState.setRestoreStatus(Status.FAILED); instanceState.getRestoreStatus().setExecutionEndTime(LocalDateTime.now());