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

#include <payload_processor.h>

Collaboration diagram for receiver::PayloadProcessor:

Public Types

enum  Result { kSuccess, kPathViolation, kUploaderError, kOtherError }
 

Public Member Functions

 PayloadProcessor ()
 
virtual ~PayloadProcessor ()
 
Result Process (int fdin, const std::string &header_digest, const std::string &path, uint64_t header_size)
 
virtual void ConsumerEventCallback (const ObjectPackBuild::Event &event)
 
virtual void OnUploadJobComplete (const upload::UploaderResults &results, void *buffer)
 
int GetNumErrors () const
 
void SetStatistics (perf::Statistics *st)
 

Protected Member Functions

virtual Result Initialize ()
 
virtual Result Finalize ()
 

Private Types

typedef std::map< shash::Any,
FileInfo >::iterator 
FileIterator
 

Private Attributes

std::map< shash::Any, FileInfopending_files_
 
std::string current_repo_
 
UniquePtr
< upload::AbstractUploader
uploader_
 
UniquePtr< RaiiTempDirtemp_dir_
 
int num_errors_
 
UniquePtr
< perf::StatisticsTemplate
statistics_
 

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 kSubmitPayload events to this class.

Its responsibility is reading the payload - containing a serialized ObjectPack - from a file descriptor, and unpacking it into the repository.

Definition at line 41 of file payload_processor.h.

Member Typedef Documentation

typedef std::map<shash::Any, FileInfo>::iterator receiver::PayloadProcessor::FileIterator
private

Definition at line 67 of file payload_processor.h.

Member Enumeration Documentation

Enumerator
kSuccess 
kPathViolation 
kUploaderError 
kOtherError 

Definition at line 43 of file payload_processor.h.

Constructor & Destructor Documentation

receiver::PayloadProcessor::PayloadProcessor ( )

Definition at line 64 of file payload_processor.cc.

receiver::PayloadProcessor::~PayloadProcessor ( )
virtual

Definition at line 72 of file payload_processor.cc.

Member Function Documentation

void receiver::PayloadProcessor::ConsumerEventCallback ( const ObjectPackBuild::Event event)
virtual

Definition at line 122 of file payload_processor.cc.

Referenced by Process().

Here is the call graph for this function:

Here is the caller graph for this function:

PayloadProcessor::Result receiver::PayloadProcessor::Finalize ( )
protectedvirtual

Definition at line 239 of file payload_processor.cc.

Referenced by Process().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 56 of file payload_processor.h.

Referenced by Finalize().

Here is the caller graph for this function:

PayloadProcessor::Result receiver::PayloadProcessor::Initialize ( )
protectedvirtual

Definition at line 199 of file payload_processor.cc.

Referenced by Process().

Here is the call graph for this function:

Here is the caller graph for this function:

void receiver::PayloadProcessor::OnUploadJobComplete ( const upload::UploaderResults results,
void *  buffer 
)
virtual

Definition at line 188 of file payload_processor.cc.

Referenced by ConsumerEventCallback().

Here is the caller graph for this function:

PayloadProcessor::Result receiver::PayloadProcessor::Process ( int  fdin,
const std::string &  header_digest,
const std::string &  path,
uint64_t  header_size 
)

Definition at line 74 of file payload_processor.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void receiver::PayloadProcessor::SetStatistics ( perf::Statistics st)

Definition at line 195 of file payload_processor.cc.

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

Here is the caller graph for this function:

Member Data Documentation

std::string receiver::PayloadProcessor::current_repo_
private

Definition at line 69 of file payload_processor.h.

Referenced by Initialize(), and Process().

int receiver::PayloadProcessor::num_errors_
private

Definition at line 72 of file payload_processor.h.

Referenced by ConsumerEventCallback(), and GetNumErrors().

std::map<shash::Any, FileInfo> receiver::PayloadProcessor::pending_files_
private

Definition at line 68 of file payload_processor.h.

Referenced by ConsumerEventCallback(), and Process().

UniquePtr<perf::StatisticsTemplate> receiver::PayloadProcessor::statistics_
private

Definition at line 73 of file payload_processor.h.

Referenced by Initialize(), and SetStatistics().

UniquePtr<RaiiTempDir> receiver::PayloadProcessor::temp_dir_
private

Definition at line 71 of file payload_processor.h.

Referenced by Finalize(), and Initialize().

UniquePtr<upload::AbstractUploader> receiver::PayloadProcessor::uploader_
private

Definition at line 70 of file payload_processor.h.

Referenced by ConsumerEventCallback(), Finalize(), and Initialize().


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