CernVM-FS
2.12.0
|
#include <catalog_traversal_parallel.h>
Classes | |
struct | CatalogJob |
Public Types | |
typedef CatalogTraversalBase < ObjectFetcherT > | Base |
typedef ObjectFetcherT | ObjectFetcherTN |
typedef ObjectFetcherT::CatalogTN | CatalogTN |
typedef ObjectFetcherT::HistoryTN | HistoryTN |
typedef CatalogTraversalData < CatalogTN > | CallbackDataTN |
typedef CatalogTN::NestedCatalogList | NestedCatalogList |
typedef Base::Parameters | Parameters |
typedef Base::TraversalType | TraversalType |
typedef std::vector< shash::Any > | HashList |
Public Types inherited from swissknife::CatalogTraversalBase< ObjectFetcherT > | |
enum | TraversalType { kBreadthFirst, kDepthFirst } |
typedef ObjectFetcherT | ObjectFetcherTN |
typedef ObjectFetcherT::CatalogTN | CatalogTN |
typedef ObjectFetcherT::HistoryTN | HistoryTN |
typedef CatalogTraversalData < CatalogTN > | CallbackDataTN |
Public Types inherited from Observable< CatalogTraversalData< ObjectFetcherT::CatalogTN > > | |
typedef Callbackable < CatalogTraversalData < ObjectFetcherT::CatalogTN > >::CallbackTN * | CallbackPtr |
Public Types inherited from Callbackable< CatalogTraversalData< ObjectFetcherT::CatalogTN > > | |
typedef CallbackBase < CatalogTraversalData < ObjectFetcherT::CatalogTN > > | CallbackTN |
Public Member Functions | |
CatalogTraversalParallel (const Parameters ¶ms) | |
bool | Traverse (const TraversalType type=Base::kBreadthFirst) |
bool | Traverse (const shash::Any &root_catalog_hash, const TraversalType type=Base::kBreadthFirst) |
bool | TraverseList (const HashList &root_catalog_list, const TraversalType type=Base::kBreadthFirst) |
bool | TraverseRevision (const shash::Any &root_catalog_hash, const TraversalType type=Base::kBreadthFirst) |
Public Member Functions inherited from swissknife::CatalogTraversalBase< ObjectFetcherT > | |
CatalogTraversalBase (const Parameters ¶ms) | |
virtual bool | TraverseList (const std::vector< shash::Any > &catalog_list, const TraversalType type=kBreadthFirst)=0 |
virtual bool | TraverseNamedSnapshots (const TraversalType type=kBreadthFirst) |
void | SetCatalogInfoShim (CatalogTraversalInfoShim< CatalogTN > *shim) |
Public Member Functions inherited from Observable< CatalogTraversalData< ObjectFetcherT::CatalogTN > > | |
virtual | ~Observable () |
CallbackPtr | RegisterListener (typename BoundClosure< CatalogTraversalData< ObjectFetcherT::CatalogTN >, DelegateT, ClosureDataT >::CallbackMethod method, DelegateT *delegate, ClosureDataT data) |
CallbackPtr | RegisterListener (typename BoundCallback< CatalogTraversalData< ObjectFetcherT::CatalogTN >, DelegateT >::CallbackMethod method, DelegateT *delegate) |
CallbackPtr | RegisterListener (typename Callback< CatalogTraversalData< ObjectFetcherT::CatalogTN > >::CallbackFunction fn) |
void | UnregisterListener (CallbackPtr callback_object) |
void | UnregisterListeners () |
Protected Member Functions | |
bool | DoTraverse () |
void | NotifyFinished () |
void | PushJob (CatalogJob *job) |
void | PushJobUnlocked (CatalogJob *job) |
void | ProcessJobPre (CatalogJob *job) |
unsigned int | PushNestedCatalogs (CatalogJob *job, const NestedCatalogList &catalog_list) |
unsigned int | PushPreviousRevision (CatalogJob *job) |
void | ProcessJobPost (CatalogJob *job) |
void | FinalizeJob (CatalogJob *job) |
void | OnChildFinished (const int &a, CatalogJob *job) |
Protected Member Functions inherited from swissknife::CatalogTraversalBase< ObjectFetcherT > | |
bool | PrepareCatalog (CatalogJob *job) |
bool | ReopenCatalog (CatalogJob *job) |
bool | CloseCatalog (const bool unlink_db, CatalogJob *job) |
shash::Any | GetRepositoryRootCatalogHash () |
bool | IsBelowPruningThresholds (const CatalogJob &job, const uint64_t history_depth, const time_t timestamp_threshold) |
Protected Member Functions inherited from Observable< CatalogTraversalData< ObjectFetcherT::CatalogTN > > | |
void | RegisterListener (CallbackPtr callback_object) |
Observable () | |
void | NotifyListeners (const CatalogTraversalData< ObjectFetcherT::CatalogTN > ¶meter) |
Static Protected Member Functions | |
static uint32_t | hasher (const shash::Any &key) |
static void * | MainProcessQueue (void *data) |
Protected Attributes | |
unsigned int | num_threads_ |
bool | serialize_callbacks_ |
uint64_t | effective_history_depth_ |
time_t | effective_timestamp_threshold_ |
TraversalType | effective_traversal_type_ |
pthread_t * | threads_process_ |
atomic_int32 | num_errors_ |
Tube< CatalogJob > | pre_job_queue_ |
Tube< CatalogJob > | post_job_queue_ |
SmallHashDynamic< shash::Any, CatalogJob * > | catalogs_processing_ |
SmallHashDynamic< shash::Any, bool > | catalogs_done_ |
pthread_mutex_t | catalogs_lock_ |
pthread_mutex_t | catalog_callback_lock_ |
Protected Attributes inherited from swissknife::CatalogTraversalBase< ObjectFetcherT > | |
ObjectFetcherT * | object_fetcher_ |
CatalogTraversalInfoShim < CatalogTN > | catalog_info_default_shim_ |
CatalogTraversalInfoShim < CatalogTN > * | catalog_info_shim_ |
const uint64_t | default_history_depth_ |
const time_t | default_timestamp_threshold_ |
const bool | no_close_ |
const bool | ignore_load_failure_ |
const bool | no_repeat_history_ |
LogFacilities | error_sink_ |
Additional Inherited Members | |
Static Public Member Functions inherited from Callbackable< CatalogTraversalData< ObjectFetcherT::CatalogTN > > | |
static CallbackTN * | MakeClosure (typename BoundClosure< CatalogTraversalData< ObjectFetcherT::CatalogTN >, DelegateT, ClosureDataT >::CallbackMethod method, DelegateT *delegate, const ClosureDataT &closure_data) |
static CallbackTN * | MakeCallback (typename BoundCallback< CatalogTraversalData< ObjectFetcherT::CatalogTN >, DelegateT >::CallbackMethod method, DelegateT *delegate) |
static CallbackTN * | MakeCallback (typename Callback< CatalogTraversalData< ObjectFetcherT::CatalogTN > >::CallbackFunction function) |
Protected Types inherited from swissknife::CatalogTraversalBase< ObjectFetcherT > | |
typedef std::set< shash::Any > | HashSet |
Protected Types inherited from Observable< CatalogTraversalData< ObjectFetcherT::CatalogTN > > | |
typedef std::set< CallbackPtr > | Callbacks |
This class implements the same functionality as CatalogTraversal, but in parallel. For common functionality, see the documentation of CatalogTraversal. Differences:
Definition at line 30 of file catalog_traversal_parallel.h.
typedef CatalogTraversalBase<ObjectFetcherT> swissknife::CatalogTraversalParallel< ObjectFetcherT >::Base |
Definition at line 32 of file catalog_traversal_parallel.h.
typedef CatalogTraversalData<CatalogTN> swissknife::CatalogTraversalParallel< ObjectFetcherT >::CallbackDataTN |
Definition at line 36 of file catalog_traversal_parallel.h.
typedef ObjectFetcherT::CatalogTN swissknife::CatalogTraversalParallel< ObjectFetcherT >::CatalogTN |
Definition at line 34 of file catalog_traversal_parallel.h.
typedef std::vector<shash::Any> swissknife::CatalogTraversalParallel< ObjectFetcherT >::HashList |
Definition at line 40 of file catalog_traversal_parallel.h.
typedef ObjectFetcherT::HistoryTN swissknife::CatalogTraversalParallel< ObjectFetcherT >::HistoryTN |
Definition at line 35 of file catalog_traversal_parallel.h.
typedef CatalogTN::NestedCatalogList swissknife::CatalogTraversalParallel< ObjectFetcherT >::NestedCatalogList |
Definition at line 37 of file catalog_traversal_parallel.h.
typedef ObjectFetcherT swissknife::CatalogTraversalParallel< ObjectFetcherT >::ObjectFetcherTN |
Definition at line 33 of file catalog_traversal_parallel.h.
typedef Base::Parameters swissknife::CatalogTraversalParallel< ObjectFetcherT >::Parameters |
Definition at line 38 of file catalog_traversal_parallel.h.
typedef Base::TraversalType swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraversalType |
Definition at line 39 of file catalog_traversal_parallel.h.
|
inlineexplicit |
Definition at line 42 of file catalog_traversal_parallel.h.
|
inlineprotected |
Definition at line 177 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::Traverse(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseList().
|
inlineprotected |
Definition at line 379 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPost(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPre().
|
inlinestaticprotected |
Definition at line 172 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::CatalogTraversalParallel().
|
inlinestaticprotected |
Definition at line 203 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::DoTraverse().
|
inlineprotected |
Definition at line 224 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::FinalizeJob(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPost(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPre().
|
inlineprotected |
Definition at line 396 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushNestedCatalogs(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushPreviousRevision().
|
inlineprotected |
Definition at line 354 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::MainProcessQueue(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPre().
|
inlineprotected |
Definition at line 243 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::MainProcessQueue().
|
inlineprotected |
Definition at line 233 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::Traverse().
|
inlineprotected |
Definition at line 238 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushJob(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushNestedCatalogs(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushPreviousRevision(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseList().
|
inlineprotected |
Definition at line 282 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPre().
|
inlineprotected |
Pushes the previous revision of a root catalog.
Definition at line 317 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPre().
|
inlinevirtual |
Starts the traversal process. After calling this methods CatalogTraversal will go through all catalogs and call the registered callback methods for each found catalog. If something goes wrong in the process, the traversal will be cancelled.
Implements swissknife::CatalogTraversalBase< ObjectFetcherT >.
Definition at line 87 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseRevision().
|
inlinevirtual |
Starts the traversal process at the catalog pointed to by the given hash
root_catalog_hash | the entry point into the catalog traversal |
Implements swissknife::CatalogTraversalBase< ObjectFetcherT >.
Definition at line 101 of file catalog_traversal_parallel.h.
|
inline |
Start the traversal process from a list of root catalogs. Same as TraverseRevision function, TraverseList does not traverse into predecessor catalog revisions and ignores TraversalParameter settings.
Definition at line 120 of file catalog_traversal_parallel.h.
|
inlinevirtual |
Starts the traversal process at the catalog pointed to by the given hash but doesn't traverse into predecessor catalog revisions. This overrides the TraversalParameter settings provided at construction.
root_catalog_hash | the entry point into the catalog traversal |
Implements swissknife::CatalogTraversalBase< ObjectFetcherT >.
Definition at line 159 of file catalog_traversal_parallel.h.
|
protected |
Definition at line 419 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::CatalogTraversalParallel(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPost().
|
protected |
Definition at line 416 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::CatalogTraversalParallel(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::FinalizeJob(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushNestedCatalogs(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushPreviousRevision(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::Traverse(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseList().
|
protected |
Definition at line 417 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::CatalogTraversalParallel(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::FinalizeJob(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPre(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushJob(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseList().
|
protected |
Definition at line 415 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::CatalogTraversalParallel(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::DoTraverse(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::FinalizeJob(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushJobUnlocked(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushNestedCatalogs(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushPreviousRevision().
|
protected |
Definition at line 406 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::CatalogTraversalParallel(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushPreviousRevision(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseList(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseRevision().
|
protected |
Definition at line 407 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::CatalogTraversalParallel(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushPreviousRevision(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseList(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseRevision().
|
protected |
Definition at line 408 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::FinalizeJob(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPre(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushNestedCatalogs(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushPreviousRevision(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::Traverse(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseList().
|
protected |
Definition at line 411 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::CatalogTraversalParallel(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::DoTraverse(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPost(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPre().
|
protected |
Definition at line 403 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::DoTraverse(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::NotifyFinished().
|
protected |
Definition at line 414 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::DoTraverse(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::FinalizeJob(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::MainProcessQueue(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::OnChildFinished().
|
protected |
Definition at line 413 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::DoTraverse(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::FinalizeJob(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::MainProcessQueue(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::NotifyFinished(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushJobUnlocked().
|
protected |
Definition at line 404 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPost().
|
protected |
Definition at line 410 of file catalog_traversal_parallel.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::DoTraverse().