vault_manager Class Reference

Select, monitor, and prepare vaults. More...

#include <vaulter.h>

Collaboration diagram for vault_manager:
Collaboration graph
[legend]

List of all members.

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
simple_lock m_lock

Detailed Description

Select, monitor, and prepare vaults.

Definition at line 9 of file vaulter.h.


Member Enumeration Documentation

Enumerator:
quit 
delete_oldest 
delete_until_free 

Definition at line 12 of file vaulter.h.

Enumerator:
max_free 
round_robbin 

Definition at line 17 of file vaulter.h.


Constructor & Destructor Documentation

vault_manager::vault_manager (  ) 

C'tor.

Definition at line 22 of file vaulter.cc.

References clear(), INTERNAL_ERROR, and vaulter.

Here is the call graph for this function:


Member Function Documentation

void vault_manager::clear ( void   ) 

Clear the vault manager.

Definition at line 30 of file vaulter.cc.

References simple_lock::clear(), m_da_err, m_deleted_archives, m_initialized, m_lock, and m_selected_vault.

Referenced by init(), test_rvm(), test_vaulter(), and vault_manager().

Here is the call graph for this function:

void vault_manager::delete_oldest_archive ( void   ) 
const std::vector< std::string > & vault_manager::deleted_archives ( void   )  const

Return a list of deleted archives.

Definition at line 733 of file vaulter.cc.

References initialized(), INTERNAL_ERROR, and m_deleted_archives.

Referenced by test_vaulter().

Here is the call graph for this function:

const bool vault_manager::err_deleted_archives ( void   )  const

Return whether or not there was an error deleting archives.

Definition at line 742 of file vaulter.cc.

References initialized(), INTERNAL_ERROR, and m_da_err.

Here is the call graph for this function:

const subdirectory vault_manager::get_archive_list ( void   ) 

Return a list of archive directories in the selected vault.

Return a list of archive directories in the selected vault, including incomplete archives. Ignore all other directories.

Definition at line 262 of file vaulter.cc.

References initialized(), INTERNAL_ERROR, is_timestamp(), subdirectory::path(), selected(), and vault().

Referenced by delete_oldest_archive(), test_vaulter(), and test_vaulter3().

Here is the call graph for this function:

void vault_manager::init ( void   ) 

Initialize the vault manager.

Definition at line 40 of file vaulter.cc.

References clear(), and m_initialized.

Referenced by main(), test_rvm(), test_vaulter(), test_vaulter1(), test_vaulter2(), and test_vaulter3().

Here is the call graph for this function:

const bool vault_manager::initialized ( void   )  const

Return the initialized status of the vault manager.

Definition at line 47 of file vaulter.cc.

References m_initialized.

Referenced by delete_oldest_archive(), deleted_archives(), err_deleted_archives(), get_archive_list(), overflow(), prepare(), select(), selected(), usage(), and vault().

const bool vault_manager::overflow ( bool  a_report = false  ) 
void vault_manager::prepare ( bool  a_assume_overflow = false  ) 

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 665 of file vaulter.cc.

References exitstat::assign(), config, delete_oldest_archive(), ERROR, exit_manager, initialized(), INTERNAL_ERROR, logger, m_deleted_archives, overflow(), configuration_manager::overflow_delete_oldest, configuration_manager::overflow_delete_until_free, configuration_manager::overflow_quit, selected(), TRY, TRY_nomem, vault(), exitstat::vault_full, 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:

void vault_manager::select ( void   ) 
const bool vault_manager::selected ( void   )  const

Return whether or not a vault has been selected yet.

Definition at line 303 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:

void vault_manager::usage ( uint16 a_blocks,
uint16 a_inodes 
) const

Return the percent of used blocks and used inodes in the selected vault.

Definition at line 317 of file vaulter.cc.

References ASSERT, filesystem::free_blocks(), filesystem::free_inodes(), initialized(), INTERNAL_ERROR, logger, max_limit(), filesystem::path(), selected(), error::str(), filesystem::total_blocks(), filesystem::total_inodes(), safe_num< T >::value(), vault(), and log_manager::write().

Referenced by delete_oldest_archive(), and overflow().

Here is the call graph for this function:

const std::string vault_manager::vault ( void   )  const

Member Data Documentation

bool vault_manager::m_da_err [private]

Definition at line 43 of file vaulter.h.

Referenced by clear(), delete_oldest_archive(), and err_deleted_archives().

std::vector<std::string> vault_manager::m_deleted_archives [private]

Definition at line 42 of file vaulter.h.

Referenced by clear(), delete_oldest_archive(), deleted_archives(), and prepare().

Definition at line 44 of file vaulter.h.

Referenced by clear(), init(), and initialized().

Definition at line 45 of file vaulter.h.

Referenced by clear(), and select().

std::string vault_manager::m_selected_vault [private]

Definition at line 41 of file vaulter.h.

Referenced by clear(), select(), selected(), and vault().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Thu Sep 30 14:09:58 2010 for rvm by  doxygen 1.6.1