CernVM-FS
2.12.0
|
#include <session_context.h>
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_ |
ObjectPack * | current_pack_ |
pthread_mutex_t | current_pack_mtx_ |
uint64_t | bytes_committed_ |
uint64_t | bytes_dispatched_ |
bool | initialized_ |
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.
upload::SessionContextBase::SessionContextBase | ( | ) |
Definition at line 76 of file session_context.cc.
|
virtual |
Definition at line 90 of file session_context.cc.
|
protectedpure virtual |
Implemented in upload::SessionContext.
Referenced by Finalize().
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().
|
private |
Definition at line 247 of file session_context.cc.
Referenced by CommitBucket(), and Finalize().
|
protectedpure virtual |
Implemented in upload::SessionContext.
Referenced by Dispatch().
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().
|
protectedpure virtual |
Implemented in upload::SessionContext.
Referenced by Finalize().
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().
|
protectedpure virtual |
Implemented in upload::SessionContext.
Referenced by Initialize().
ObjectPack::BucketHandle upload::SessionContextBase::NewBucket | ( | ) |
Definition at line 187 of file session_context.cc.
Referenced by upload::GatewayUploader::DoUpload(), and upload::GatewayUploader::InitStreamedUpload().
|
inline |
Definition at line 59 of file session_context.h.
Referenced by upload::GatewayUploader::WaitForUpload().
|
private |
Definition at line 91 of file session_context.h.
Referenced by CommitBucket(), Finalize(), and NewBucket().
|
protected |
Definition at line 81 of file session_context.h.
Referenced by upload::SessionContext::Commit(), upload::SessionContext::DoUpload(), and Initialize().
|
private |
Definition at line 96 of file session_context.h.
Referenced by CommitBucket(), Finalize(), and Initialize().
|
private |
Definition at line 97 of file session_context.h.
Referenced by Dispatch(), Finalize(), and Initialize().
|
private |
Definition at line 93 of file session_context.h.
Referenced by CommitBucket(), Dispatch(), Finalize(), Initialize(), and NewBucket().
|
private |
Definition at line 94 of file session_context.h.
Referenced by CommitBucket(), Dispatch(), Finalize(), Initialize(), and NewBucket().
|
private |
Definition at line 99 of file session_context.h.
Referenced by Finalize(), and Initialize().
|
protected |
Definition at line 83 of file session_context.h.
Referenced by upload::SessionContext::Commit(), upload::SessionContext::DoUpload(), and Initialize().
|
private |
Definition at line 89 of file session_context.h.
Referenced by CommitBucket(), Initialize(), and NewBucket().
|
protected |
Definition at line 84 of file session_context.h.
Referenced by upload::SessionContext::Commit(), upload::SessionContext::DoUpload(), and Initialize().
|
protected |
Definition at line 82 of file session_context.h.
Referenced by upload::SessionContext::Commit(), upload::SessionContext::DoUpload(), and Initialize().
Definition at line 79 of file session_context.h.
Referenced by Dispatch(), Finalize(), and Initialize().