CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
receiver::CommitProcessor Class Reference

#include <commit_processor.h>

Collaboration diagram for receiver::CommitProcessor:

Public Types

enum  Result { kSuccess, kError, kMergeFailure, kMissingReflog }
 

Public Member Functions

 CommitProcessor ()
 
virtual ~CommitProcessor ()
 
Result Process (const std::string &lease_path, const shash::Any &old_root_hash, const shash::Any &new_root_hash, const RepositoryTag &tag, uint64_t *final_revision)
 
int GetNumErrors () const
 
void SetStatistics (perf::Statistics *st, const std::string &start_time)
 

Private Attributes

int num_errors_
 
perf::Statisticsstatistics_
 
std::string start_time_
 

Detailed Description

This class is used in the cvmfs_receiver tool, on repository gateway machines. The receiver::Reactor class, implementing the event loop of the cvmfs_receiver tool, dispatches the handling of the kCommit events to this class.

Its responsibility is updating the repository (sub-)catalogs with the changes introduced during the lease. After all the catalogs have been updated, the repository manifest is also updated and resigned.

Definition at line 26 of file commit_processor.h.

Member Enumeration Documentation

Enumerator
kSuccess 
kError 
kMergeFailure 
kMissingReflog 

Definition at line 28 of file commit_processor.h.

Constructor & Destructor Documentation

receiver::CommitProcessor::CommitProcessor ( )

Definition at line 81 of file commit_processor.cc.

receiver::CommitProcessor::~CommitProcessor ( )
virtual

Definition at line 83 of file commit_processor.cc.

Member Function Documentation

int receiver::CommitProcessor::GetNumErrors ( ) const
inline

Definition at line 37 of file commit_processor.h.

CommitProcessor::Result receiver::CommitProcessor::Process ( const std::string &  lease_path,
const shash::Any old_root_hash,
const shash::Any new_root_hash,
const RepositoryTag tag,
uint64_t *  final_revision 
)

Applies the changes from the new catalog onto the repository.

Let:

  • C_O = the root catalog of the repository (given by old_root_hash) at the beginning of the lease, on the release manager machine
  • C_N = the root catalog of the repository (given by new_root_hash), on the release manager machine, with the changes introduced during the lease
  • C_G = the current root catalog of the repository on the gateway machine.

This method applies all the changes from C_N, with respect to C_O, onto C_G. The resulting catalog on the gateway machine (C_GN) is then set as root catalog in the repository manifest. The method also signs the updated repository manifest.

Definition at line 101 of file commit_processor.cc.

Referenced by receiver::Reactor::HandleCommit().

Here is the call graph for this function:

Here is the caller graph for this function:

void receiver::CommitProcessor::SetStatistics ( perf::Statistics st,
const std::string &  start_time 
)

Definition at line 308 of file commit_processor.cc.

Referenced by receiver::Reactor::HandleCommit().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

int receiver::CommitProcessor::num_errors_
private

Definition at line 42 of file commit_processor.h.

Referenced by GetNumErrors().

std::string receiver::CommitProcessor::start_time_
private

Definition at line 44 of file commit_processor.h.

Referenced by Process(), and SetStatistics().

perf::Statistics* receiver::CommitProcessor::statistics_
private

Definition at line 43 of file commit_processor.h.

Referenced by Process(), and SetStatistics().


The documentation for this class was generated from the following files: