CernVM-FS
2.12.0
|
#include <upload_local.h>
Public Member Functions | |
LocalUploader (const SpoolerDefinition &spooler_definition) | |
virtual std::string | name () const |
virtual bool | Create () |
void | DoUpload (const std::string &remote_path, IngestionSource *source, const CallbackTN *callback) |
UploadStreamHandle * | InitStreamedUpload (const CallbackTN *callback) |
void | StreamedUpload (UploadStreamHandle *handle, UploadBuffer buffer, const CallbackTN *callback=NULL) |
void | FinalizeStreamedUpload (UploadStreamHandle *handle, const shash::Any &content_hash) |
void | DoRemoveAsync (const std::string &file_to_delete) |
bool | Peek (const std::string &path) |
bool | Mkdir (const std::string &path) |
bool | PlaceBootstrappingShortcut (const shash::Any &object) |
unsigned int | GetNumberOfErrors () const |
int64_t | DoGetObjectSize (const std::string &file_name) |
Public Member Functions inherited from upload::AbstractUploader | |
virtual | ~AbstractUploader () |
virtual unsigned | GetNumTasks () const |
virtual bool | Initialize () |
virtual bool | FinalizeSession (bool commit, const std::string &old_root_hash, const std::string &new_root_hash, const RepositoryTag &tag) |
void | TearDown () |
void | UploadFile (const std::string &local_path, const std::string &remote_path, const CallbackTN *callback=NULL) |
void | UploadIngestionSource (const std::string &remote_path, IngestionSource *source, const CallbackTN *callback=NULL) |
void | ScheduleUpload (UploadStreamHandle *handle, UploadBuffer buffer, const CallbackTN *callback=NULL) |
void | ScheduleCommit (UploadStreamHandle *handle, const shash::Any &content_hash) |
void | RemoveAsync (const std::string &file_to_delete) |
void | RemoveAsync (const shash::Any &hash_to_delete) |
int64_t | GetObjectSize (const shash::Any &hash) |
virtual void | WaitForUpload () const |
void | InitCounters (perf::StatisticsTemplate *statistics) |
Public Member Functions inherited from PolymorphicConstructionImpl< AbstractUploader, SpoolerDefinition, void > | |
virtual | ~PolymorphicConstructionImpl () |
Static Public Member Functions | |
static bool | WillHandle (const SpoolerDefinition &spooler_definition) |
Static Public Member Functions inherited from upload::AbstractUploader | |
static void | RegisterPlugins () |
Static Public Member Functions inherited from PolymorphicConstruction< AbstractUploader, SpoolerDefinition > | |
static IntrospectionData | Introspect () |
Static Public Member Functions inherited from PolymorphicConstructionImpl< AbstractUploader, SpoolerDefinition, void > | |
static AbstractUploader * | Construct (const SpoolerDefinition ¶m) |
Static Public Member Functions inherited from Callbackable< UploaderResults > | |
static CallbackTN * | MakeClosure (typename BoundClosure< UploaderResults, DelegateT, ClosureDataT >::CallbackMethod method, DelegateT *delegate, const ClosureDataT &closure_data) |
static CallbackTN * | MakeCallback (typename BoundCallback< UploaderResults, DelegateT >::CallbackMethod method, DelegateT *delegate) |
static CallbackTN * | MakeCallback (typename Callback< UploaderResults >::CallbackFunction function) |
Protected Member Functions | |
int | Move (const std::string &local_path, const std::string &remote_path) const |
Protected Member Functions inherited from upload::AbstractUploader | |
AbstractUploader (const SpoolerDefinition &spooler_definition) | |
void | Respond (const CallbackTN *callback, const UploaderResults &result) const |
int | CreateAndOpenTemporaryChunkFile (std::string *path) const |
const SpoolerDefinition & | spooler_definition () const |
void | CountUploadedChunks () const |
void | DecUploadedChunks () const |
void | CountUploadedBytes (int64_t bytes_written) const |
void | CountDuplicates () const |
void | CountUploadedCatalogs () const |
void | CountUploadedCatalogBytes (int64_t bytes_written) const |
void | IncJobsInFlight () |
Protected Member Functions inherited from SingleCopy | |
SingleCopy () | |
Private Attributes | |
const mode_t | backend_file_mode_ |
const mode_t | backend_dir_mode_ |
const std::string | upstream_path_ |
const std::string | temporary_path_ |
atomic_int32 | copy_errors_ |
Static Private Attributes | |
static const mode_t | default_backend_file_mode_ = 0666 |
static const mode_t | default_backend_dir_mode_ = 0777 |
Additional Inherited Members | |
Public Types inherited from PolymorphicConstruction< AbstractUploader, SpoolerDefinition > | |
typedef std::vector< void > | IntrospectionData |
Public Types inherited from Callbackable< UploaderResults > | |
typedef CallbackBase < UploaderResults > | CallbackTN |
Protected Types inherited from upload::AbstractUploader | |
typedef Callbackable < UploaderResults > ::CallbackTN * | CallbackPtr |
Protected Types inherited from PolymorphicConstructionImpl< AbstractUploader, SpoolerDefinition, void > | |
typedef AbstractFactory < AbstractUploader, SpoolerDefinition, void > | Factory |
typedef std::vector< Factory * > | RegisteredPlugins |
Static Protected Member Functions inherited from PolymorphicConstructionImpl< AbstractUploader, SpoolerDefinition, void > | |
static void | LazilyRegisterPlugins () |
static void | RegisterPlugin () |
Static Protected Attributes inherited from PolymorphicConstructionImpl< AbstractUploader, SpoolerDefinition, void > | |
static RegisteredPlugins | registered_plugins_ |
The LocalSpooler implements the AbstractSpooler interface to push files into a local CVMFS repository backend. For a detailed description of the classes interface please have a look into the AbstractSpooler base class.
Definition at line 36 of file upload_local.h.
|
explicit |
|
virtual |
Initializes a new repository storage area, e.g. create directory layout for local backend or create bucket for S3 backend.
Implements upload::AbstractUploader.
Definition at line 39 of file upload_local.cc.
|
virtual |
Implements upload::AbstractUploader.
Definition at line 260 of file upload_local.cc.
|
virtual |
TODO(jblomer): investigate if parallelism increases the GC speed on local disks.
Implements upload::AbstractUploader.
Definition at line 210 of file upload_local.cc.
|
virtual |
Upload() is not done concurrently in the current implementation of the LocalSpooler, since it is a simple move or copy of a file without CPU intensive operation This method calls NotifyListeners and invokes a callback for all registered listeners (see the Observable template for details).
Implements upload::AbstractUploader.
Definition at line 44 of file upload_local.cc.
|
virtual |
Implementation of streamed upload commit Public interface: AbstractUploader::ScheduleUpload()
handle | descendant of UploadStreamHandle specifying the stream |
content_hash | the computed content hash of the streamed object |
Implements upload::AbstractUploader.
Definition at line 144 of file upload_local.cc.
|
virtual |
Determines the number of failed jobs in the LocalCompressionWorker as well as in the Upload() command.
Implements upload::AbstractUploader.
Definition at line 35 of file upload_local.cc.
|
virtual |
This method is called before the first data block of a streamed upload is scheduled (see above implementation of UploadStreamHandle for details).
callback | (optional) this callback will be invoked once this parti- cular streamed upload is committed. |
Implements upload::AbstractUploader.
Definition at line 109 of file upload_local.cc.
|
virtual |
Make directory in upstream storage. Noop if directory already present.
path | relative directory path in the upstream storage |
Implements upload::AbstractUploader.
Definition at line 222 of file upload_local.cc.
|
protected |
Definition at line 232 of file upload_local.cc.
Referenced by DoUpload(), and FinalizeStreamedUpload().
|
inlinevirtual |
A string identifying the uploader type
Implements upload::AbstractUploader.
Definition at line 47 of file upload_local.h.
|
virtual |
Checks if a file is already present in the backend storage. This might be a synchronous operation.
path | the path of the file to be checked |
Implements upload::AbstractUploader.
Definition at line 217 of file upload_local.cc.
Referenced by FinalizeStreamedUpload().
|
virtual |
Creates a top-level shortcut to the given data object. This is particularly useful for bootstrapping repositories whose data-directory is secured by a VOMS certificate.
object | content hash of the object to be exposed on the top-level |
Implements upload::AbstractUploader.
Definition at line 226 of file upload_local.cc.
|
virtual |
Implementation of a streamed upload step. See public interface for details. Public interface: AbstractUploader::ScheduleUpload()
handle | descendant of UploadStreamHandle specifying the stream |
buffer | the CharBuffer to be uploaded to the stream |
callback | callback to be called on completion |
Implements upload::AbstractUploader.
Definition at line 121 of file upload_local.cc.
|
static |
Definition at line 31 of file upload_local.cc.
|
private |
Definition at line 41 of file upload_local.h.
|
private |
Definition at line 40 of file upload_local.h.
Referenced by Move().
|
mutableprivate |
counts the number of occurred errors in Upload()
Definition at line 91 of file upload_local.h.
Referenced by DoRemoveAsync(), DoUpload(), FinalizeStreamedUpload(), GetNumberOfErrors(), InitStreamedUpload(), LocalUploader(), and StreamedUpload().
|
staticprivate |
Definition at line 39 of file upload_local.h.
|
staticprivate |
Definition at line 38 of file upload_local.h.
|
private |
Definition at line 90 of file upload_local.h.
Referenced by DoUpload().
|
private |
Definition at line 89 of file upload_local.h.
Referenced by Create(), DoGetObjectSize(), DoRemoveAsync(), FinalizeStreamedUpload(), Mkdir(), Move(), Peek(), and PlaceBootstrappingShortcut().