| Line |
Branch |
Exec |
Source |
| 1 |
|
|
/** |
| 2 |
|
|
* This file is part of the CernVM File System. |
| 3 |
|
|
*/ |
| 4 |
|
|
|
| 5 |
|
|
#ifndef CVMFS_INGESTION_TASK_REGISTER_H_ |
| 6 |
|
|
#define CVMFS_INGESTION_TASK_REGISTER_H_ |
| 7 |
|
|
|
| 8 |
|
|
#include "ingestion/item.h" |
| 9 |
|
|
#include "ingestion/task.h" |
| 10 |
|
|
#include "upload_spooler_result.h" |
| 11 |
|
|
#include "util/concurrency.h" |
| 12 |
|
|
#include "util/tube.h" |
| 13 |
|
|
|
| 14 |
|
|
/** |
| 15 |
|
|
* Runs the callback to register processed files in the file catalog. |
| 16 |
|
|
* Encapsulated in a task so that only a single thread operates on the file |
| 17 |
|
|
* catalog, which is serialized anyway. |
| 18 |
|
|
*/ |
| 19 |
|
|
class TaskRegister : public TubeConsumer<FileItem>, |
| 20 |
|
|
public Observable<upload::SpoolerResult> { |
| 21 |
|
|
public: |
| 22 |
|
12904 |
TaskRegister(Tube<FileItem> *tube_in, |
| 23 |
|
|
Tube<FileItem> *tube_ctr_inflight_pre, |
| 24 |
|
|
Tube<FileItem> *tube_ctr_inflight_post) |
| 25 |
|
12904 |
: TubeConsumer<FileItem>(tube_in) |
| 26 |
|
12904 |
, tube_ctr_inflight_pre_(tube_ctr_inflight_pre) |
| 27 |
|
12904 |
, tube_ctr_inflight_post_(tube_ctr_inflight_post) { } |
| 28 |
|
|
|
| 29 |
|
|
protected: |
| 30 |
|
|
virtual void Process(FileItem *file_item); |
| 31 |
|
|
|
| 32 |
|
|
private: |
| 33 |
|
|
Tube<FileItem> *tube_ctr_inflight_pre_; |
| 34 |
|
|
Tube<FileItem> *tube_ctr_inflight_post_; |
| 35 |
|
|
}; // class TaskRegister |
| 36 |
|
|
|
| 37 |
|
|
#endif // CVMFS_INGESTION_TASK_REGISTER_H_ |
| 38 |
|
|
|