![]() |
CernVM-FS
2.12.0
|
#include <catalog_traversal.h>
Classes | |
struct | CatalogJob |
struct | Parameters |
Public Types | |
enum | TraversalType { kBreadthFirst, kDepthFirst } |
typedef ObjectFetcherT | ObjectFetcherTN |
typedef ObjectFetcherT::CatalogTN | CatalogTN |
typedef ObjectFetcherT::HistoryTN | HistoryTN |
typedef CatalogTraversalData < CatalogTN > | CallbackDataTN |
![]() | |
typedef Callbackable < CatalogTraversalData < ObjectFetcherT::CatalogTN > >::CallbackTN * | CallbackPtr |
![]() | |
typedef CallbackBase < CatalogTraversalData < ObjectFetcherT::CatalogTN > > | CallbackTN |
Public Member Functions | |
CatalogTraversalBase (const Parameters ¶ms) | |
virtual bool | Traverse (const TraversalType type=kBreadthFirst)=0 |
virtual bool | Traverse (const shash::Any &root_catalog_hash, const TraversalType type=kBreadthFirst)=0 |
virtual bool | TraverseList (const std::vector< shash::Any > &catalog_list, const TraversalType type=kBreadthFirst)=0 |
virtual bool | TraverseRevision (const shash::Any &root_catalog_hash, const TraversalType type=kBreadthFirst)=0 |
virtual bool | TraverseNamedSnapshots (const TraversalType type=kBreadthFirst) |
void | SetCatalogInfoShim (CatalogTraversalInfoShim< CatalogTN > *shim) |
![]() | |
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 Types | |
typedef std::set< shash::Any > | HashSet |
![]() | |
typedef std::set< CallbackPtr > | Callbacks |
Protected Member Functions | |
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) |
![]() | |
void | RegisterListener (CallbackPtr callback_object) |
Observable () | |
void | NotifyListeners (const CatalogTraversalData< ObjectFetcherT::CatalogTN > ¶meter) |
Protected Attributes | |
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 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) |
A base class for CatalogTraversal and CatalogTraversalParallel implementing common functionality. Actual traversal classes inherit from this class.
Definition at line 88 of file catalog_traversal.h.
typedef CatalogTraversalData<CatalogTN> swissknife::CatalogTraversalBase< ObjectFetcherT >::CallbackDataTN |
Definition at line 95 of file catalog_traversal.h.
typedef ObjectFetcherT::CatalogTN swissknife::CatalogTraversalBase< ObjectFetcherT >::CatalogTN |
Definition at line 93 of file catalog_traversal.h.
|
protected |
Definition at line 268 of file catalog_traversal.h.
typedef ObjectFetcherT::HistoryTN swissknife::CatalogTraversalBase< ObjectFetcherT >::HistoryTN |
Definition at line 94 of file catalog_traversal.h.
typedef ObjectFetcherT swissknife::CatalogTraversalBase< ObjectFetcherT >::ObjectFetcherTN |
Definition at line 92 of file catalog_traversal.h.
enum swissknife::CatalogTraversalBase::TraversalType |
Enumerator | |
---|---|
kBreadthFirst | |
kDepthFirst |
Definition at line 162 of file catalog_traversal.h.
|
inlineexplicit |
|
inlineprotected |
Definition at line 373 of file catalog_traversal.h.
Referenced by swissknife::CatalogTraversal< ObjectFetcherT >::PostponeYield(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPost(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPre(), and swissknife::CatalogTraversal< ObjectFetcherT >::Yield().
|
inlineprotected |
Definition at line 388 of file catalog_traversal.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::Traverse(), and swissknife::CatalogTraversal< ObjectFetcherT >::Traverse().
|
inlineprotected |
Checks if a root catalog is below one of the pruning thresholds. Pruning thresholds can be either the catalog's history depth or a timestamp threshold applied to the last modified timestamp of the catalog.
ctx | traversal context for traversal-specific state |
job | the job defining the current catalog |
Definition at line 414 of file catalog_traversal.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushPreviousRevision(), and swissknife::CatalogTraversal< ObjectFetcherT >::PushPreviousRevision().
|
inlineprotected |
Definition at line 314 of file catalog_traversal.h.
Referenced by swissknife::CatalogTraversal< ObjectFetcherT >::DoTraverse(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPre().
|
inlineprotected |
Definition at line 353 of file catalog_traversal.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPost().
|
inline |
Definition at line 263 of file catalog_traversal.h.
|
pure virtual |
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.
type | breadths or depth first traversal |
Implemented in swissknife::CatalogTraversal< ObjectFetcherT >, and swissknife::CatalogTraversalParallel< ObjectFetcherT >.
|
pure virtual |
Starts the traversal process at the catalog pointed to by the given hash
root_catalog_hash | the entry point into the catalog traversal |
type | breadths or depth first traversal |
Implemented in swissknife::CatalogTraversal< ObjectFetcherT >, and swissknife::CatalogTraversalParallel< ObjectFetcherT >.
|
pure virtual |
Traverse a list of revisions represented by root catalogs from first to last. DO NOT traverse previous revisions based on history and timestamp threshold settings.
catalog_list | list of root catalog hashes |
type | breadth- or depth- first traversal |
Implemented in swissknife::CatalogTraversal< ObjectFetcherT >.
Referenced by swissknife::CatalogTraversalBase< ObjectFetcherT >::TraverseNamedSnapshots().
|
inlinevirtual |
Figures out all named tags in a repository and uses all of them as entry points into the traversal process.
type | breadths or depth first traversal |
Definition at line 233 of file catalog_traversal.h.
|
pure virtual |
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 |
type | breadths or depth first traversal |
Implemented in swissknife::CatalogTraversal< ObjectFetcherT >, and swissknife::CatalogTraversalParallel< ObjectFetcherT >.
|
protected |
Definition at line 432 of file catalog_traversal.h.
|
protected |
Definition at line 433 of file catalog_traversal.h.
Referenced by swissknife::CatalogTraversalBase< ObjectFetcherT >::IsBelowPruningThresholds(), and swissknife::CatalogTraversalBase< ObjectFetcherT >::SetCatalogInfoShim().
|
protected |
Definition at line 434 of file catalog_traversal.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::CatalogTraversalParallel(), swissknife::CatalogTraversal< ObjectFetcherT >::Traverse(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseList(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseRevision().
|
protected |
Definition at line 435 of file catalog_traversal.h.
Referenced by swissknife::CatalogTraversalParallel< ObjectFetcherT >::CatalogTraversalParallel(), swissknife::CatalogTraversal< ObjectFetcherT >::Traverse(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseList(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseRevision().
|
protected |
|
protected |
Definition at line 437 of file catalog_traversal.h.
Referenced by swissknife::CatalogTraversalBase< ObjectFetcherT >::PrepareCatalog().
|
protected |
Definition at line 436 of file catalog_traversal.h.
Referenced by swissknife::CatalogTraversal< ObjectFetcherT >::PostponeYield(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::ProcessJobPost(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushNestedCatalogs(), swissknife::CatalogTraversal< ObjectFetcherT >::PushNestedCatalogs(), and swissknife::CatalogTraversal< ObjectFetcherT >::Yield().
|
protected |
Definition at line 438 of file catalog_traversal.h.
Referenced by swissknife::CatalogTraversal< ObjectFetcherT >::MarkAsVisited(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushNestedCatalogs(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::PushPreviousRevision(), swissknife::CatalogTraversal< ObjectFetcherT >::ShouldBeSkipped(), swissknife::CatalogTraversalParallel< ObjectFetcherT >::Traverse(), and swissknife::CatalogTraversalParallel< ObjectFetcherT >::TraverseList().
|
protected |
Definition at line 431 of file catalog_traversal.h.
Referenced by swissknife::CatalogTraversalBase< ObjectFetcherT >::CatalogTraversalBase(), swissknife::CatalogTraversalBase< ObjectFetcherT >::GetRepositoryRootCatalogHash(), swissknife::CatalogTraversalBase< ObjectFetcherT >::PrepareCatalog(), and swissknife::CatalogTraversalBase< ObjectFetcherT >::TraverseNamedSnapshots().