MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / serialise_database

Function serialise_database

tools/comdb2ar/serialise.cpp:753–1514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

751}
752
753void serialise_database(
754 std::string lrlpath,
755 std::string repl_type,
756 std::string repl_name,
757 const std::string& comdb2_task,
758 bool disable_log_deletion,
759 bool strip_cluster_info,
760 bool support_files_only,
761 bool run_with_done_file,
762 bool do_direct_io,
763 bool incr_create,
764 bool incr_gen,
765 bool copy_physical,
766 bool add_latency,
767 const std::string& incr_path
768)
769// Serialise a database into tape archive format and write it to stdout.
770// If support_only is true then only support files (lrl and schema) will
771// be serialised. If disable_log_deletion and the database is running then
772// it will be advised to hold log file deletion until the backup is complete
773// (highly recommended!)
774{
775 std::string dbname;
776 std::string dbdir;
777 std::string dbtxndir;
778 bool nonames = false;
779 bool has_cluster_info = false;
780 std::string origlrlname("");
781 std::string strippedpath("");
782 std::string templrlpath("");
783
784 // All support files - csc2s, extra lrls, resources for stored procedures,
785 // SSL certificates
786 // etc.
787 std::list<std::string> support_files;
788
789 // All tables. In llmeta mode we don't have a table list
790 std::set<std::string> table_names;
791
792 // All queues
793 std::set<std::string> queue_names;
794 std::set<std::string> queuedb_names;
795
796 // Optional files. Nice if found, but not nececssary
797 std::list<std::string> optional_files;
798
799 // Vector of logfile numbers to detect gaps
800 std::vector<int> logvec;
801
802 // Iterator for logvec
803 std::vector<int>::iterator logit;
804
805 // Current logfile, log errors
806 int curlog=0, logerr=0;
807
808 parse_lrl_file(lrlpath, &dbname, &dbdir, &support_files,
809 &table_names, &queue_names, &nonames, &has_cluster_info);
810

Callers 1

mainFunction · 0.85

Calls 15

parse_lrl_fileFunction · 0.85
check_usenamesFunction · 0.85
ErrorClass · 0.85
create_lrl_fileFunction · 0.85
strip_clusterFunction · 0.85
RepopNewLrlClass · 0.85
LRLErrorClass · 0.85
listdirFunction · 0.85
sortFunction · 0.85
SerialiseErrorClass · 0.85
recognize_data_fileFunction · 0.85
FileInfoClass · 0.85

Tested by

no test coverage detected