rvm 1.08
Public Member Functions | Private Member Functions | Private Attributes

archive_manager Class Reference

Create (or update an existing) archive in the selected vault. More...

#include <archiver.h>

List of all members.

Public Member Functions

 archive_manager ()
 C'tor.
void clear (void)
 Clear the archive manager and clear the job list.
void init (void)
 Initialize the archive manager.
const bool initialized (void) const
 Return the initialized status of the archive manager.
void archive (void)
 Archive jobs.
const std::string archive_path (void) const
 Return an absolute path to the finished archive directory.
const std::string working_archive_path (void) const
 Return the absolute path to the unfinished working archive directory.

Private Member Functions

void mf_log_status (void)
 Give a status report.

Private Attributes

std::vector< job_archiver * > m_jobs
bool m_initialized

Detailed Description

Create (or update an existing) archive in the selected vault.

Definition at line 98 of file archiver.h.


Constructor & Destructor Documentation

archive_manager::archive_manager ( )

C'tor.

Definition at line 1119 of file archiver.cc.

References archiver, clear(), and INTERNAL_ERROR.

Here is the call graph for this function:


Member Function Documentation

void archive_manager::archive ( void  )

Archive jobs.

Create an archive directory. Generate a to-do list of job archiver objects. Process the job archiver objects:

  • While there are less than rsync-parallel job archivers processing, start the first available job archiver.
  • Check the status of each job and process I/O from jobs underway.
  • Remove jobs that failed to start.
  • Possibly reschedule failed jobs.
  • Remove completed jobs from active processing.
  • Call mf_log_status().

Definition at line 1296 of file archiver.cc.

References vault_report::add_report(), jobs_report::add_report(), archive_path(), estring::clear(), config, timer::duration(), err_nomem, err_unknown, ERROR, exists(), initialized(), INTERNAL_ERROR, report_manager::jobs(), configuration_manager::jobs(), logger, m_jobs, mf_log_status(), mk_dir(), error::num(), vault_manager::overflow(), vault_manager::prepare(), rename_file(), reporter, configuration_manager::rsync_parallel(), timer::start(), job_archiver::status_completed, job_archiver::status_error, job_archiver::status_fatal_error, job_archiver::status_pending, job_archiver::status_processing, job_archiver::status_reschedule, timer::stop(), TRY, TRY_nomem, vault_manager::vault(), report_manager::vault(), vaulter, working_archive_path(), writable(), and log_manager::write().

Referenced by main(), and test_rvm().

Here is the call graph for this function:

const std::string archive_manager::archive_path ( void  ) const

Return an absolute path to the finished archive directory.

Definition at line 1566 of file archiver.cc.

References config, initialized(), INTERNAL_ERROR, timestamp::str(), configuration_manager::timestamp(), vault_manager::vault(), and vaulter.

Referenced by archive(), and working_archive_path().

Here is the call graph for this function:

void archive_manager::clear ( void  )

Clear the archive manager and clear the job list.

Definition at line 1128 of file archiver.cc.

References m_initialized, and m_jobs.

Referenced by archive_manager(), and test_rvm().

void archive_manager::init ( void  )

Initialize the archive manager.

Log the archive timestamp, select and prepare a vault.

Definition at line 1139 of file archiver.cc.

References vault_report::add_report(), config, timer::duration(), logger, m_initialized, vault_manager::prepare(), reporter, vault_manager::select(), timer::start(), timer::stop(), timestamp::str(), configuration_manager::timestamp(), report_manager::vault(), vault_manager::vault(), vaulter, and log_manager::write().

Referenced by main(), and test_rvm().

Here is the call graph for this function:

const bool archive_manager::initialized ( void  ) const

Return the initialized status of the archive manager.

Definition at line 1178 of file archiver.cc.

References m_initialized.

Referenced by archive(), archive_path(), and working_archive_path().

void archive_manager::mf_log_status ( void  ) [private]

Give a status report.

After so many minutes of inactivity write a report to the log file of our current status of affairs.

Definition at line 1189 of file archiver.cc.

References timer::duration_mins(), timer::is_started(), logger, m_jobs, vault_manager::overflow(), timer::start(), job_archiver::status_completed, job_archiver::status_done, job_archiver::status_error, job_archiver::status_fatal_error, job_archiver::status_pending, job_archiver::status_processing, job_archiver::status_reschedule, timer::stop(), vaulter, and log_manager::write().

Referenced by archive().

Here is the call graph for this function:

const std::string archive_manager::working_archive_path ( void  ) const

Return the absolute path to the unfinished working archive directory.

Definition at line 1581 of file archiver.cc.

References archive_path(), initialized(), and INTERNAL_ERROR.

Referenced by archive(), job_archiver::mf_do_chores(), and job_archiver::start().

Here is the call graph for this function:


Member Data Documentation

Definition at line 113 of file archiver.h.

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

std::vector<job_archiver*> archive_manager::m_jobs [private]

Definition at line 112 of file archiver.h.

Referenced by archive(), clear(), and mf_log_status().


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