#include <vaulter.h>
Public Types | |
enum | vault_manager_overflow_type { quit, delete_oldest, delete_until_free } |
enum | vault_manager_selection_type { max_free, round_robbin } |
Public Member Functions | |
vault_manager () | |
C'tor. | |
void | clear (void) |
Clear the vault manager. | |
void | init (void) |
Initialize the vault manager. | |
const bool | initialized (void) const |
Return the initialized status of the vault manager. | |
void | select (void) |
Select a vault. | |
const std::string | vault (void) const |
Return the path to the selected vault. | |
const bool | selected (void) const |
Return whether or not a vault has been selected yet. | |
void | usage (uint16 &a_blocks, uint16 &a_inodes) const |
Return the percent of used blocks and used inodes in the selected vault. | |
const bool | overflow (bool a_report=false) |
Test to see if a vault has exceeded it's overflow threshold. | |
void | delete_oldest_archive (void) |
Find the oldest archive in the vault and delete it. | |
void | prepare (bool a_assume_overflow=false) |
Prepare the selected vault. | |
const std::vector< std::string > & | deleted_archives (void) const |
Return a list of deleted archives. | |
const bool | err_deleted_archives (void) const |
Return whether or not there was an error deleting archives. | |
const subdirectory | get_archive_list (void) |
Return a list of archive directories in the selected vault. | |
Private Attributes | |
std::string | m_selected_vault |
std::vector< std::string > | m_deleted_archives |
bool | m_da_err |
bool | m_initialized |
Definition at line 9 of file vaulter.h.
|
|
|
|
|
C'tor.
Definition at line 22 of file vaulter.cc. References clear(), INTERNAL_ERROR, and vaulter. |
Here is the call graph for this function:
|
Clear the vault manager.
Definition at line 30 of file vaulter.cc. References m_da_err, m_deleted_archives, and m_selected_vault. Referenced by init(), test_rvm(), and vault_manager(). |
|
Find the oldest archive in the vault and delete it.
Definition at line 331 of file vaulter.cc. References vault_report::add_report(), exitstat::assign(), config, timer::duration(), ERROR, exit_manager, get_archive_list(), initialized(), INTERNAL_ERROR, logger, m_da_err, m_deleted_archives, percent_string(), reporter, rm_recursive(), selected(), timer::start(), timer::stop(), timestamp::str(), configuration_manager::timestamp(), TRY_nomem, usage(), report_manager::vault(), vault(), and log_manager::write(). Referenced by prepare(). |
Here is the call graph for this function:
|
Return a list of deleted archives.
Definition at line 484 of file vaulter.cc. References initialized(), INTERNAL_ERROR, and m_deleted_archives. |
Here is the call graph for this function:
|
Return whether or not there was an error deleting archives.
Definition at line 493 of file vaulter.cc. References initialized(), INTERNAL_ERROR, and m_da_err. |
Here is the call graph for this function:
|
Return a list of archive directories in the selected vault.
Definition at line 178 of file vaulter.cc. References initialized(), INTERNAL_ERROR, subdirectory::path(), selected(), and vault(). Referenced by delete_oldest_archive(). |
Here is the call graph for this function:
|
Initialize the vault manager.
Definition at line 39 of file vaulter.cc. References clear(). Referenced by main(), test_rvm(), and test_vaulter(). |
Here is the call graph for this function:
|
Return the initialized status of the vault manager.
Definition at line 46 of file vaulter.cc. Referenced by delete_oldest_archive(), deleted_archives(), err_deleted_archives(), get_archive_list(), overflow(), prepare(), select(), selected(), usage(), and vault(). |
|
Test to see if a vault has exceeded it's overflow threshold.
Definition at line 277 of file vaulter.cc. References vault_report::add_report(), config, initialized(), INTERNAL_ERROR, logger, percent_string(), reporter, selected(), TRY_nomem, usage(), report_manager::vault(), vault(), configuration_manager::vault_overflow_blocks(), configuration_manager::vault_overflow_inodes(), and log_manager::write(). Referenced by archive_manager::archive(), job_archiver::mf_process_rsync_io(), and prepare(). |
Here is the call graph for this function:
|
Prepare the selected vault. Check the selected vault for overflow. If the overflow threshold has been exceeded and the vault-overflow-behavior setting is not quit, then delete the oldest archive in the vault. Depending on vault-overflow-behavior, possibly repeat this action until either there is space free or there are no archives left in the vault. Definition at line 416 of file vaulter.cc. References exitstat::assign(), config, delete_oldest_archive(), ERROR, exit_manager, initialized(), INTERNAL_ERROR, logger, m_deleted_archives, overflow(), selected(), TRY, TRY_nomem, vault(), configuration_manager::vault_overflow_behavior(), and log_manager::write(). Referenced by archive_manager::archive(), and archive_manager::init(). |
Here is the call graph for this function:
|
Select a vault. If an archive of the same timestamp for the given timestamp resolution already exists on any vault, then that vault is selected. Otherwise select a vault according to vault-selection-behavior. Definition at line 58 of file vaulter.cc. References config, err_nomem, err_unknown, ERROR, filesystem::free_blocks(), initialized(), INTERNAL_ERROR, m_selected_vault, filesystem::path(), subdirectory::path(), error::push_back(), timestamp::str(), configuration_manager::timestamp(), TRY_nomem, configuration_manager::vault_selection_behavior(), and configuration_manager::vaults(). Referenced by archive_manager::init(), and test_vaulter(). |
Here is the call graph for this function:
|
Return whether or not a vault has been selected yet.
Definition at line 206 of file vaulter.cc. References initialized(), INTERNAL_ERROR, and m_selected_vault. Referenced by delete_oldest_archive(), get_archive_list(), overflow(), prepare(), usage(), and vault(). |
Here is the call graph for this function:
|
Return the percent of used blocks and used inodes in the selected vault.
Definition at line 220 of file vaulter.cc. References ASSERT, filesystem::free_blocks(), filesystem::free_inodes(), initialized(), INTERNAL_ERROR, logger, max_limit(), filesystem::path(), selected(), filesystem::total_blocks(), filesystem::total_inodes(), vault(), and log_manager::write(). Referenced by delete_oldest_archive(), and overflow(). |
Here is the call graph for this function:
|
Return the path to the selected vault.
Definition at line 194 of file vaulter.cc. References initialized(), INTERNAL_ERROR, m_selected_vault, and selected(). Referenced by archive_manager::archive(), archive_manager::archive_path(), delete_oldest_archive(), vault_report::format_synopsis(), get_archive_list(), archive_manager::init(), job_archiver::mf_do_chores(), overflow(), prepare(), test_rvm(), test_vaulter(), and usage(). |
Here is the call graph for this function:
|
Definition at line 43 of file vaulter.h. Referenced by clear(), delete_oldest_archive(), and err_deleted_archives(). |
|
Definition at line 42 of file vaulter.h. Referenced by clear(), delete_oldest_archive(), deleted_archives(), and prepare(). |
|
|
|
Definition at line 41 of file vaulter.h. Referenced by clear(), select(), selected(), and vault(). |