CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
upload::SessionContextBase Class Referenceabstract

#include <session_context.h>

Inheritance diagram for upload::SessionContextBase:
Collaboration diagram for upload::SessionContextBase:

Public Member Functions

 SessionContextBase ()
 
virtual ~SessionContextBase ()
 
bool Initialize (const std::string &api_url, const std::string &session_token, const std::string &key_id, const std::string &secret, uint64_t max_pack_size=ObjectPack::kDefaultLimit, uint64_t max_queue_size=10)
 
bool Finalize (bool commit, const std::string &old_root_hash, const std::string &new_root_hash, const RepositoryTag &tag)
 
void WaitForUpload ()
 
ObjectPack::BucketHandle NewBucket ()
 
bool CommitBucket (const ObjectPack::BucketContentType type, const shash::Any &id, const ObjectPack::BucketHandle handle, const std::string &name="", const bool force_dispatch=false)
 

Protected Member Functions

virtual bool InitializeDerived (uint64_t max_queue_size)=0
 
virtual bool FinalizeDerived ()=0
 
virtual bool Commit (const std::string &old_root_hash, const std::string &new_root_hash, const RepositoryTag &tag)=0
 
virtual Future< bool > * DispatchObjectPack (ObjectPack *pack)=0
 

Protected Attributes

Tube< Future< bool > > upload_results_
 
std::string api_url_
 
std::string session_token_
 
std::string key_id_
 
std::string secret_
 

Private Member Functions

void Dispatch ()
 

Private Attributes

uint64_t max_pack_size_
 
std::vector
< ObjectPack::BucketHandle
active_handles_
 
ObjectPackcurrent_pack_
 
pthread_mutex_t current_pack_mtx_
 
uint64_t bytes_committed_
 
uint64_t bytes_dispatched_
 
bool initialized_
 

Detailed Description

This class implements a context for a single publish operation

The context is created at the start of a publish operation and is supposed to live at least until the payload has been submitted to the repo services.

It is the GatewayUploader concrete class which handles the creation and destruction of the SessionContext. A session should begin when the spooler and uploaders are initialized and should last until the call to Spooler::WaitForUpload().

Definition at line 43 of file session_context.h.

Constructor & Destructor Documentation

upload::SessionContextBase::SessionContextBase ( )

Definition at line 76 of file session_context.cc.

upload::SessionContextBase::~SessionContextBase ( )
virtual

Definition at line 90 of file session_context.cc.

Member Function Documentation

virtual bool upload::SessionContextBase::Commit ( const std::string &  old_root_hash,
const std::string &  new_root_hash,
const RepositoryTag tag 
)
protectedpure virtual

Implemented in upload::SessionContext.

Referenced by Finalize().

Here is the caller graph for this function:

bool upload::SessionContextBase::CommitBucket ( const ObjectPack::BucketContentType  type,
const shash::Any id,
const ObjectPack::BucketHandle  handle,
const std::string &  name = "",
const bool  force_dispatch = false 
)

Definition at line 197 of file session_context.cc.

Referenced by upload::GatewayUploader::DoUpload(), and upload::GatewayUploader::FinalizeStreamedUpload().

Here is the call graph for this function:

Here is the caller graph for this function:

void upload::SessionContextBase::Dispatch ( )
private

Definition at line 247 of file session_context.cc.

Referenced by CommitBucket(), and Finalize().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual Future<bool>* upload::SessionContextBase::DispatchObjectPack ( ObjectPack pack)
protectedpure virtual

Implemented in upload::SessionContext.

Referenced by Dispatch().

Here is the caller graph for this function:

bool upload::SessionContextBase::Finalize ( bool  commit,
const std::string &  old_root_hash,
const std::string &  new_root_hash,
const RepositoryTag tag 
)

Definition at line 138 of file session_context.cc.

Referenced by upload::GatewayUploader::FinalizeSession().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool upload::SessionContextBase::FinalizeDerived ( )
protectedpure virtual

Implemented in upload::SessionContext.

Referenced by Finalize().

Here is the caller graph for this function:

bool upload::SessionContextBase::Initialize ( const std::string &  api_url,
const std::string &  session_token,
const std::string &  key_id,
const std::string &  secret,
uint64_t  max_pack_size = ObjectPack::kDefaultLimit,
uint64_t  max_queue_size = 10 
)

Definition at line 92 of file session_context.cc.

Referenced by upload::GatewayUploader::Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool upload::SessionContextBase::InitializeDerived ( uint64_t  max_queue_size)
protectedpure virtual

Implemented in upload::SessionContext.

Referenced by Initialize().

Here is the caller graph for this function:

ObjectPack::BucketHandle upload::SessionContextBase::NewBucket ( )

Definition at line 187 of file session_context.cc.

Referenced by upload::GatewayUploader::DoUpload(), and upload::GatewayUploader::InitStreamedUpload().

Here is the call graph for this function:

Here is the caller graph for this function:

void upload::SessionContextBase::WaitForUpload ( )
inline

Definition at line 59 of file session_context.h.

Referenced by upload::GatewayUploader::WaitForUpload().

Here is the caller graph for this function:

Member Data Documentation

std::vector<ObjectPack::BucketHandle> upload::SessionContextBase::active_handles_
private

Definition at line 91 of file session_context.h.

Referenced by CommitBucket(), Finalize(), and NewBucket().

std::string upload::SessionContextBase::api_url_
protected
uint64_t upload::SessionContextBase::bytes_committed_
private

Definition at line 96 of file session_context.h.

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

uint64_t upload::SessionContextBase::bytes_dispatched_
private

Definition at line 97 of file session_context.h.

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

ObjectPack* upload::SessionContextBase::current_pack_
private

Definition at line 93 of file session_context.h.

Referenced by CommitBucket(), Dispatch(), Finalize(), Initialize(), and NewBucket().

pthread_mutex_t upload::SessionContextBase::current_pack_mtx_
private

Definition at line 94 of file session_context.h.

Referenced by CommitBucket(), Dispatch(), Finalize(), Initialize(), and NewBucket().

bool upload::SessionContextBase::initialized_
private

Definition at line 99 of file session_context.h.

Referenced by Finalize(), and Initialize().

std::string upload::SessionContextBase::key_id_
protected
uint64_t upload::SessionContextBase::max_pack_size_
private

Definition at line 89 of file session_context.h.

Referenced by CommitBucket(), Initialize(), and NewBucket().

std::string upload::SessionContextBase::secret_
protected
std::string upload::SessionContextBase::session_token_
protected
Tube<Future<bool> > upload::SessionContextBase::upload_results_
protected

Definition at line 79 of file session_context.h.

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


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