sumitagrawl commented on code in PR #8917:
URL: https://github.com/apache/ozone/pull/8917#discussion_r2267010046
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ReconDBProvider.java:
##########
@@ -115,4 +128,25 @@ public void close() throws Exception {
dbStore = null;
}
}
+
+ public void replaceStagedDb(ReconDBProvider stagedReconDBProvider) throws
Exception {
+ File dbPath = dbStore.getDbLocation();
+ File stagedDbPath = stagedReconDBProvider.getDbStore().getDbLocation();
+ File backupPath = new File(dbPath.getAbsolutePath() + ".backup");
+ stagedReconDBProvider.close();
+ try {
+ FileUtils.deleteDirectory(backupPath);
+ FileUtils.moveDirectory(dbPath, backupPath);
Review Comment:
I am thinking to keep one backup to be there, so avoided cleanup. For next
backup, it will be cleaned.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]