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

Function create_partials

tools/comdb2ar/serialise.cpp:1632–1734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1630}
1631
1632void create_partials(
1633 const std::string &lrlpath, bool do_direct_io
1634)
1635// create a tarball of incremental data files for all data files, and nothing else
1636{
1637 std::string dbname, dbdir;
1638 std::list<std::string> support_files;
1639 std::set<std::string> table_names;
1640 std::set<std::string> queue_names;
1641 bool nonames;
1642 bool has_cluster_info;
1643 std::list<std::string> dbdir_files;
1644 std::string abspath;
1645
1646 std::string templ_fstblk;
1647 std::string templ_llmeta;
1648 std::string templ_metadata;
1649 std::string templ_blkseq_dta;
1650 std::string templ_blkseq_freerec;
1651 std::string templ_blkseq_ix0;
1652
1653
1654 parse_lrl_file(lrlpath, &dbname, &dbdir,
1655 &support_files, &table_names,
1656 &queue_names, &nonames, &has_cluster_info);
1657
1658 if (!dbdir.empty() && !dbname.empty()) {
1659 nonames = check_usenames(dbname, dbdir, nonames);
1660 }
1661
1662 if(nonames) {
1663 templ_fstblk = "comdb2_fstblk.dta";
1664 templ_llmeta = "comdb2_llmeta.dta";
1665 templ_metadata = "comdb2_metadata.dta";
1666 templ_blkseq_dta = "comdb2_blkseq.dta";
1667 templ_blkseq_freerec = "comdb2_blkseq.freerec";
1668 templ_blkseq_ix0 = "comdb2_blkseq.ix0";
1669 } else {
1670 templ_fstblk = dbname + ".fstblk.dta";
1671 templ_llmeta = dbname + ".llmeta.dta";
1672 templ_metadata = dbname + ".metadata.dta";
1673 templ_blkseq_dta = dbname + ".blkseq.dta";
1674 templ_blkseq_freerec = dbname + ".blkseq.freerec";
1675 templ_blkseq_ix0 = dbname + ".blkseq.ix0";
1676 }
1677
1678 // We just care about dbdir. Ignore everything else.
1679 listdir(dbdir_files, dbdir);
1680
1681 // Incremental backups generate a fingerprint to establish parent/child
1682 // relationships. We don't really need this, but the restore process
1683 // expects it, so generate it.
1684 std::string sha = generate_fingerprint();
1685 serialise_string("fingerprint.sha", sha);
1686
1687 for (std::list<std::string>::const_iterator it = dbdir_files.begin(); it != dbdir_files.end(); ++it) {
1688 bool is_data_file, is_queue_file, is_queuedb_file;
1689 std::string table;

Callers 1

mainFunction · 0.85

Calls 12

parse_lrl_fileFunction · 0.85
check_usenamesFunction · 0.85
listdirFunction · 0.85
generate_fingerprintFunction · 0.85
serialise_stringFunction · 0.85
ErrorClass · 0.85
recognize_data_fileFunction · 0.85
write_incremental_fileFunction · 0.85
writepaddingFunction · 0.85
emptyMethod · 0.80
statClass · 0.70
whatMethod · 0.45

Tested by

no test coverage detected