5 #ifndef CVMFS_UPLOAD_FACILITY_H_
6 #define CVMFS_UPLOAD_FACILITY_H_
34 "n_chunks_added",
"Number of new chunks added");
36 "n_chunks_duplicated",
"Number of duplicated chunks added");
38 "n_catalogs_added",
"Number of new catalogs added");
40 "sz_uploaded_bytes",
"Number of uploaded bytes");
42 "sz_uploaded_catalog_bytes",
"Number of uploaded bytes for catalogs");
51 return_code(return_code),
52 local_path(local_path) {}
56 return_code(return_code),
143 virtual std::string
name()
const = 0;
149 virtual bool Create() = 0;
175 virtual bool FinalizeSession(
bool commit,
const std::string &old_root_hash,
176 const std::string &new_root_hash,
195 const std::string &local_path,
196 const std::string &remote_path,
201 DoUpload(remote_path, &source, callback);
205 const std::string &remote_path,
210 DoUpload(remote_path, source, callback);
300 virtual bool Peek(
const std::string &path) = 0;
308 virtual bool Mkdir(
const std::string &path) = 0;
346 virtual void DoUpload(
const std::string &remote_path,
373 virtual void DoRemoveAsync(
const std::string &file_to_delete) = 0;
389 if (callback != NULL) {
474 : commit_callback(commit_callback)
487 #endif // CVMFS_UPLOAD_FACILITY_H_
static UploadJob * CreateQuitBeacon()
virtual ~UploadStreamHandle()
virtual void WaitForUpload() const
void InitCounters(perf::StatisticsTemplate *statistics)
void ScheduleUpload(UploadStreamHandle *handle, UploadBuffer buffer, const CallbackTN *callback=NULL)
perf::Counter * n_chunks_duplicated
virtual void DoRemoveAsync(const std::string &file_to_delete)=0
UploadBuffer(uint64_t s, const void *d)
UniquePtr< UploadCounters > counters_
SynchronizingCounter< int32_t > jobs_in_flight_
int CreateAndOpenTemporaryChunkFile(std::string *path) const
virtual bool Mkdir(const std::string &path)=0
virtual UploadStreamHandle * InitStreamedUpload(const CallbackTN *callback)=0
void Respond(const CallbackTN *callback, const UploaderResults &result) const
virtual int64_t DoGetObjectSize(const std::string &file_name)=0
Counter * RegisterOrLookupTemplated(const std::string &name_minor, const std::string &desc)
void ScheduleCommit(UploadStreamHandle *handle, const shash::Any &content_hash)
unsigned num_upload_tasks_
void DecUploadedChunks() const
assert((mem||(size==0))&&"Out Of Memory")
const SpoolerDefinition & spooler_definition() const
TaskUpload(AbstractUploader *uploader, Tube< AbstractUploader::UploadJob > *tube)
void CountUploadedChunks() const
virtual bool PlaceBootstrappingShortcut(const shash::Any &object)=0
virtual unsigned GetNumTasks() const
UploadStreamHandle * stream_handle
const CallbackTN * commit_callback
virtual bool FinalizeSession(bool commit, const std::string &old_root_hash, const std::string &new_root_hash, const RepositoryTag &tag)
virtual bool Initialize()
int64_t GetObjectSize(const shash::Any &hash)
void RemoveAsync(const shash::Any &hash_to_delete)
virtual void FinalizeStreamedUpload(UploadStreamHandle *handle, const shash::Any &content_hash)=0
virtual bool Peek(const std::string &path)=0
Callbackable< UploaderResults >::CallbackTN * CallbackPtr
perf::Counter * sz_uploaded_catalog_bytes
static atomic_int64 g_upload_stream_tag
void CountUploadedBytes(int64_t bytes_written) const
virtual void StreamedUpload(UploadStreamHandle *handle, UploadBuffer buffer, const CallbackTN *callback)=0
UploaderResults(const int return_code, const std::string &local_path)
AbstractUploader(const SpoolerDefinition &spooler_definition)
virtual unsigned int GetNumberOfErrors() const =0
virtual std::string name() const =0
UploaderResults(Type t, const int return_code)
void CountDuplicates() const
void UploadFile(const std::string &local_path, const std::string &remote_path, const CallbackTN *callback=NULL)
AbstractUploader::CallbackTN CallbackTN
void CountUploadedCatalogBytes(int64_t bytes_written) const
perf::Counter * n_chunks_added
void RemoveAsync(const std::string &file_to_delete)
virtual void DoUpload(const std::string &remote_path, IngestionSource *source, const CallbackTN *callback)=0
void CountUploadedCatalogs() const
TubeGroup< UploadJob > tubes_upload_
const std::string local_path
perf::Counter * n_catalogs_added
static void RegisterPlugins()
const SpoolerDefinition spooler_definition_
const CallbackTN * callback
TubeConsumerGroup< UploadJob > tasks_upload_
std::string MakePath() const
void UploadIngestionSource(const std::string &remote_path, IngestionSource *source, const CallbackTN *callback=NULL)
CallbackBase< UploaderResults > CallbackTN
UploadCounters(perf::StatisticsTemplate statistics)
virtual ~AbstractUploader()
virtual void Process(AbstractUploader::UploadJob *upload_job)
perf::Counter * sz_uploaded_bytes
AbstractUploader * uploader_
UploadStreamHandle(const CallbackTN *commit_callback)