hycdong commented on code in PR #1112:
URL: https://github.com/apache/incubator-pegasus/pull/1112#discussion_r948691663


##########
src/rdsn/src/common/backup_restore_common.h:
##########
@@ -52,5 +57,69 @@ class backup_restore_constant
     static const std::string RESTORE_PATH;
 };
 
+/// The directory structure on block service
+///
+/// (<root> = <user_define_root>/<cluster>)
+///
+///  <root>/<app_name>_<app_id>/<backup_id>/<pidx>/chkpt_<ip>_<port>/***.sst
+///                                        /<pidx>/chkpt_<ip>_<port>/CURRENT
+///                                        /<pidx>/chkpt_<ip>_<port>/IDENTITY
+///                                        /<pidx>/chkpt_<ip>_<port>/MANIFEST
+///                                        /<pidx>/chkpt_<ip>_<port>/OPTIONS
+///                                        /<pidx>/chkpt_<ip>_<port>/LOG
+///                                        
/<pidx>/chkpt_<ip>_<port>/backup_metadata
+///                                        /<pidx>/current_checkpoint
+///                                        /<pidx>/data_version
+///
+///  ......other partitions......
+///
+///  <root>/<app_name>_<app_id>/<backup_id>/meta/app_metadata
+///  <root>/<app_name>_<app_id>/<backup_id>/backup_info
+///
+
+///
+/// The usage of files:
+///      1, app_metadata : the metadata of the app, the same with the app's 
app_info
+///      2, backup_metadata : the file to statistic the information of a 
checkpoint, include all the
+///         file's name, size and md5
+///      3, current_checkpoint : specifing which checkpoint directory is valid
+///      4, data_version: partition data_version
+///      5, backup_info : recording the information of this backup
+
+// TODO(heyuchen): add other common functions
+// get_compatible_backup_root is only used for restore compatible backup
+
+// The backup root path on block service
+// if user_defined_root_path is not empty
+// - return <user_defined_root_path>/<backup_root>
+// else
+// - return <backup_root>
+std::string get_backup_root(const std::string &backup_root,

Review Comment:
   All functions in `backup_restore_common.h` will be used in meta and replica 
files, backup and restore logic, so I move them into `backup_restore_common.h`. 
This file is added in my last round refactor. I will resolve the following 
similar conversation.



-- 
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: dev-unsubscr...@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pegasus.apache.org
For additional commands, e-mail: dev-h...@pegasus.apache.org

Reply via email to