CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr > Class Template Reference

#include <catalog_merge_tool.h>

Inheritance diagram for receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >:
Collaboration diagram for receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >:

Public Member Functions

 CatalogMergeTool (RoCatalogMgr *old_catalog_mgr, RoCatalogMgr *new_catalog_mgr, RwCatalogMgr *output_catalog_mgr, const PathString &lease_path, const std::string &temp_dir_prefix, manifest::Manifest *manifest, perf::Statistics *statistics)
 
 CatalogMergeTool (RoCatalogMgr *old_catalog_mgr, RoCatalogMgr *new_catalog_mgr, const std::string &repo_path, const PathString &lease_path, const std::string &temp_dir_prefix, download::DownloadManager *download_manager, manifest::Manifest *manifest, perf::Statistics *statistics)
 
 CatalogMergeTool (const std::string &repo_path, const shash::Any &old_root_hash, const shash::Any &new_root_hash, const PathString &lease_path, const std::string &temp_dir_prefix, download::DownloadManager *download_manager, manifest::Manifest *manifest, perf::Statistics *statistics)
 
virtual ~CatalogMergeTool ()
 
bool Run (const Params &params, std::string *new_manifest_path, uint64_t *final_rev)
 
- Public Member Functions inherited from CatalogDiffTool< RoCatalogMgr >
 CatalogDiffTool (RoCatalogMgr *old_catalog_mgr, RoCatalogMgr *new_catalog_mgr)
 
 CatalogDiffTool (const std::string &repo_path, const shash::Any &old_root_hash, const shash::Any &new_root_hash, const std::string &temp_dir_prefix, download::DownloadManager *download_manager)
 
virtual ~CatalogDiffTool ()
 
bool Init ()
 
bool Run (const PathString &path)
 

Protected Member Functions

virtual bool IsIgnoredPath (const PathString &path)
 
virtual bool IsReportablePath (const PathString &path)
 
virtual void ReportAddition (const PathString &path, const catalog::DirectoryEntry &entry, const XattrList &xattrs, const FileChunkList &chunks)
 
virtual void ReportRemoval (const PathString &path, const catalog::DirectoryEntry &entry)
 
virtual bool ReportModification (const PathString &path, const catalog::DirectoryEntry &old_entry, const catalog::DirectoryEntry &new_entry, const XattrList &xattrs, const FileChunkList &chunks)
 
- Protected Member Functions inherited from CatalogDiffTool< RoCatalogMgr >
const catalog::CatalogGetOldCatalog () const
 
const catalog::CatalogGetNewCatalog () const
 
RoCatalogMgr * GetOldCatalogMgr ()
 
RoCatalogMgr * GetNewCatalogMgr ()
 

Private Member Functions

bool CreateNewManifest (std::string *new_manifest_path)
 

Private Attributes

std::string repo_path_
 
PathString lease_path_
 
std::string temp_dir_prefix_
 
download::DownloadManagerdownload_manager_
 
manifest::Manifestmanifest_
 
UniquePtr< RwCatalogMgr > output_catalog_mgr_
 
const bool needs_setup_
 
perf::Statisticsstatistics_
 
UniquePtr< perf::FsCounterscounters_
 

Detailed Description

template<typename RwCatalogMgr, typename RoCatalogMgr>
class receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >

Definition at line 35 of file catalog_merge_tool.h.

Constructor & Destructor Documentation

template<typename RwCatalogMgr , typename RoCatalogMgr >
receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::CatalogMergeTool ( RoCatalogMgr *  old_catalog_mgr,
RoCatalogMgr *  new_catalog_mgr,
RwCatalogMgr *  output_catalog_mgr,
const PathString lease_path,
const std::string &  temp_dir_prefix,
manifest::Manifest manifest,
perf::Statistics statistics 
)
inline

Definition at line 37 of file catalog_merge_tool.h.

template<typename RwCatalogMgr , typename RoCatalogMgr >
receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::CatalogMergeTool ( RoCatalogMgr *  old_catalog_mgr,
RoCatalogMgr *  new_catalog_mgr,
const std::string &  repo_path,
const PathString lease_path,
const std::string &  temp_dir_prefix,
download::DownloadManager download_manager,
manifest::Manifest manifest,
perf::Statistics statistics 
)
inline

Definition at line 54 of file catalog_merge_tool.h.

template<typename RwCatalogMgr , typename RoCatalogMgr >
receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::CatalogMergeTool ( const std::string &  repo_path,
const shash::Any old_root_hash,
const shash::Any new_root_hash,
const PathString lease_path,
const std::string &  temp_dir_prefix,
download::DownloadManager download_manager,
manifest::Manifest manifest,
perf::Statistics statistics 
)
inline

Definition at line 71 of file catalog_merge_tool.h.

template<typename RwCatalogMgr , typename RoCatalogMgr >
virtual receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::~CatalogMergeTool ( )
inlinevirtual

Definition at line 90 of file catalog_merge_tool.h.

Member Function Documentation

template<typename RwCatalogMgr , typename RoCatalogMgr >
bool receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::CreateNewManifest ( std::string *  new_manifest_path)
private

Definition at line 292 of file catalog_merge_tool_impl.h.

Here is the call graph for this function:

template<typename RwCatalogMgr , typename RoCatalogMgr >
bool receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::IsIgnoredPath ( const PathString path)
protectedvirtual

Check if a path (and, by implication, any subpath) should be ignored and not considered for comparison purposes.

This can be used to avoid unnecessary work by avoiding recursion into paths that will not be of interest (e.g. paths that are neither above nor within the lease path, when using a gateway).

Reimplemented from CatalogDiffTool< RoCatalogMgr >.

Definition at line 89 of file catalog_merge_tool_impl.h.

Here is the call graph for this function:

template<typename RwCatalogMgr , typename RoCatalogMgr >
bool receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::IsReportablePath ( const PathString path)
protectedvirtual

Check if a difference found on a path should be reported via ReportAddition(), ReportRemoval(), or ReportModification().

This can be used to filter out differences that are not of interest (e.g. paths that are not within the lease path, when using a gateway).

Note that an ignored path must necessarily be a non-reportable path, since an ignored path will never even be compared (and so can never be reported upon). However, there do exist paths that are neither ignored nor reportable: when using a gateway, a parent of the lease path is not reportable (since it is not within the lease path) but must not be ignored (since we need to recurse into the parent path in order to reach the lease path).

As a concrete example, with a lease path of /foo/bar:

/foo <- not ignored, not reportable /foo/bar <- not ignored reportable /foo/bar/thing <- not ignored reportable /foo/baz <- ignored (and therefore not reportable)

Reimplemented from CatalogDiffTool< RoCatalogMgr >.

Definition at line 100 of file catalog_merge_tool_impl.h.

Here is the call graph for this function:

template<typename RwCatalogMgr , typename RoCatalogMgr >
void receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::ReportAddition ( const PathString path,
const catalog::DirectoryEntry entry,
const XattrList xattrs,
const FileChunkList chunks 
)
protectedvirtual

Implements CatalogDiffTool< RoCatalogMgr >.

Definition at line 110 of file catalog_merge_tool_impl.h.

Here is the call graph for this function:

template<typename RwCatalogMgr , typename RoCatalogMgr >
bool receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::ReportModification ( const PathString path,
const catalog::DirectoryEntry old_entry,
const catalog::DirectoryEntry new_entry,
const XattrList xattrs,
const FileChunkList chunks 
)
protectedvirtual

Implements CatalogDiffTool< RoCatalogMgr >.

Definition at line 171 of file catalog_merge_tool_impl.h.

Here is the call graph for this function:

template<typename RwCatalogMgr , typename RoCatalogMgr >
void receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::ReportRemoval ( const PathString path,
const catalog::DirectoryEntry entry 
)
protectedvirtual

Implements CatalogDiffTool< RoCatalogMgr >.

Definition at line 145 of file catalog_merge_tool_impl.h.

Here is the call graph for this function:

template<typename RwCatalogMgr , typename RoCatalogMgr >
bool receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::Run ( const Params params,
std::string *  new_manifest_path,
uint64_t *  final_rev 
)

Definition at line 54 of file catalog_merge_tool_impl.h.

Here is the call graph for this function:

Member Data Documentation

template<typename RwCatalogMgr , typename RoCatalogMgr >
UniquePtr<perf::FsCounters> receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::counters_
private

Definition at line 128 of file catalog_merge_tool.h.

template<typename RwCatalogMgr , typename RoCatalogMgr >
download::DownloadManager* receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::download_manager_
private

Definition at line 119 of file catalog_merge_tool.h.

template<typename RwCatalogMgr , typename RoCatalogMgr >
PathString receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::lease_path_
private

Definition at line 116 of file catalog_merge_tool.h.

template<typename RwCatalogMgr , typename RoCatalogMgr >
manifest::Manifest* receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::manifest_
private

Definition at line 121 of file catalog_merge_tool.h.

template<typename RwCatalogMgr , typename RoCatalogMgr >
const bool receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::needs_setup_
private

Definition at line 125 of file catalog_merge_tool.h.

template<typename RwCatalogMgr , typename RoCatalogMgr >
UniquePtr<RwCatalogMgr> receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::output_catalog_mgr_
private

Definition at line 123 of file catalog_merge_tool.h.

template<typename RwCatalogMgr , typename RoCatalogMgr >
std::string receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::repo_path_
private

Definition at line 114 of file catalog_merge_tool.h.

template<typename RwCatalogMgr , typename RoCatalogMgr >
perf::Statistics* receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::statistics_
private

Definition at line 127 of file catalog_merge_tool.h.

template<typename RwCatalogMgr , typename RoCatalogMgr >
std::string receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::temp_dir_prefix_
private

Definition at line 117 of file catalog_merge_tool.h.


The documentation for this class was generated from the following files: