CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CatalogDiffTool< RoCatalogMgr > Class Template Referenceabstract

#include <catalog_diff_tool.h>

Inheritance diagram for CatalogDiffTool< RoCatalogMgr >:
Collaboration diagram for CatalogDiffTool< RoCatalogMgr >:

Public Member Functions

 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)=0
 
virtual void ReportRemoval (const PathString &path, const catalog::DirectoryEntry &entry)=0
 
virtual bool ReportModification (const PathString &path, const catalog::DirectoryEntry &old_entry, const catalog::DirectoryEntry &new_entry, const XattrList &xattrs, const FileChunkList &chunks)=0
 
const catalog::CatalogGetOldCatalog () const
 
const catalog::CatalogGetNewCatalog () const
 
RoCatalogMgr * GetOldCatalogMgr ()
 
RoCatalogMgr * GetNewCatalogMgr ()
 

Private Member Functions

RoCatalogMgr * OpenCatalogManager (const std::string &repo_path, const std::string &temp_dir, const shash::Any &root_hash, download::DownloadManager *download_manager, perf::Statistics *stats)
 
void DiffRec (const PathString &path)
 

Private Attributes

std::string repo_path_
 
shash::Any old_root_hash_
 
shash::Any new_root_hash_
 
std::string temp_dir_prefix_
 
download::DownloadManagerdownload_manager_
 
perf::Statistics stats_old_
 
perf::Statistics stats_new_
 
UniquePtr< RaiiTempDirold_raii_temp_dir_
 
UniquePtr< RaiiTempDirnew_raii_temp_dir_
 
UniquePtr< RoCatalogMgr > old_catalog_mgr_
 
UniquePtr< RoCatalogMgr > new_catalog_mgr_
 
const bool needs_setup_
 

Detailed Description

template<typename RoCatalogMgr>
class CatalogDiffTool< RoCatalogMgr >

Definition at line 23 of file catalog_diff_tool.h.

Constructor & Destructor Documentation

template<typename RoCatalogMgr>
CatalogDiffTool< RoCatalogMgr >::CatalogDiffTool ( RoCatalogMgr *  old_catalog_mgr,
RoCatalogMgr *  new_catalog_mgr 
)
inline

Definition at line 25 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
CatalogDiffTool< RoCatalogMgr >::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 
)
inline

Definition at line 33 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
virtual CatalogDiffTool< RoCatalogMgr >::~CatalogDiffTool ( )
inlinevirtual

Definition at line 48 of file catalog_diff_tool.h.

Member Function Documentation

template<typename RoCatalogMgr >
void CatalogDiffTool< RoCatalogMgr >::DiffRec ( const PathString path)
private

Definition at line 96 of file catalog_diff_tool_impl.h.

Here is the call graph for this function:

template<typename RoCatalogMgr>
const catalog::Catalog* CatalogDiffTool< RoCatalogMgr >::GetNewCatalog ( ) const
inlineprotected

Definition at line 105 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
RoCatalogMgr* CatalogDiffTool< RoCatalogMgr >::GetNewCatalogMgr ( )
inlineprotected

Definition at line 111 of file catalog_diff_tool.h.

Referenced by receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::ReportModification().

Here is the caller graph for this function:

template<typename RoCatalogMgr>
const catalog::Catalog* CatalogDiffTool< RoCatalogMgr >::GetOldCatalog ( ) const
inlineprotected

Definition at line 102 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
RoCatalogMgr* CatalogDiffTool< RoCatalogMgr >::GetOldCatalogMgr ( )
inlineprotected

Definition at line 108 of file catalog_diff_tool.h.

template<typename RoCatalogMgr >
bool CatalogDiffTool< RoCatalogMgr >::Init ( )

Definition at line 46 of file catalog_diff_tool_impl.h.

Here is the call graph for this function:

template<typename RoCatalogMgr>
virtual bool CatalogDiffTool< RoCatalogMgr >::IsIgnoredPath ( const PathString path)
inlineprotectedvirtual

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 in receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >.

Definition at line 63 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
virtual bool CatalogDiffTool< RoCatalogMgr >::IsReportablePath ( const PathString path)
inlineprotectedvirtual

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 in receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >.

Definition at line 88 of file catalog_diff_tool.h.

template<typename RoCatalogMgr >
RoCatalogMgr * CatalogDiffTool< RoCatalogMgr >::OpenCatalogManager ( const std::string &  repo_path,
const std::string &  temp_dir,
const shash::Any root_hash,
download::DownloadManager download_manager,
perf::Statistics stats 
)
private

Definition at line 84 of file catalog_diff_tool_impl.h.

template<typename RoCatalogMgr>
virtual void CatalogDiffTool< RoCatalogMgr >::ReportAddition ( const PathString path,
const catalog::DirectoryEntry entry,
const XattrList xattrs,
const FileChunkList chunks 
)
protectedpure virtual
template<typename RoCatalogMgr>
virtual bool CatalogDiffTool< RoCatalogMgr >::ReportModification ( const PathString path,
const catalog::DirectoryEntry old_entry,
const catalog::DirectoryEntry new_entry,
const XattrList xattrs,
const FileChunkList chunks 
)
protectedpure virtual
template<typename RoCatalogMgr>
virtual void CatalogDiffTool< RoCatalogMgr >::ReportRemoval ( const PathString path,
const catalog::DirectoryEntry entry 
)
protectedpure virtual
template<typename RoCatalogMgr >
bool CatalogDiffTool< RoCatalogMgr >::Run ( const PathString path)

Definition at line 77 of file catalog_diff_tool_impl.h.

Referenced by receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::Run().

Here is the caller graph for this function:

Member Data Documentation

template<typename RoCatalogMgr>
download::DownloadManager* CatalogDiffTool< RoCatalogMgr >::download_manager_
private

Definition at line 129 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
const bool CatalogDiffTool< RoCatalogMgr >::needs_setup_
private

Definition at line 140 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
UniquePtr<RoCatalogMgr> CatalogDiffTool< RoCatalogMgr >::new_catalog_mgr_
private
template<typename RoCatalogMgr>
UniquePtr<RaiiTempDir> CatalogDiffTool< RoCatalogMgr >::new_raii_temp_dir_
private

Definition at line 135 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
shash::Any CatalogDiffTool< RoCatalogMgr >::new_root_hash_
private

Definition at line 126 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
UniquePtr<RoCatalogMgr> CatalogDiffTool< RoCatalogMgr >::old_catalog_mgr_
private
template<typename RoCatalogMgr>
UniquePtr<RaiiTempDir> CatalogDiffTool< RoCatalogMgr >::old_raii_temp_dir_
private

Definition at line 134 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
shash::Any CatalogDiffTool< RoCatalogMgr >::old_root_hash_
private

Definition at line 125 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
std::string CatalogDiffTool< RoCatalogMgr >::repo_path_
private

Definition at line 124 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
perf::Statistics CatalogDiffTool< RoCatalogMgr >::stats_new_
private

Definition at line 132 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
perf::Statistics CatalogDiffTool< RoCatalogMgr >::stats_old_
private

Definition at line 131 of file catalog_diff_tool.h.

template<typename RoCatalogMgr>
std::string CatalogDiffTool< RoCatalogMgr >::temp_dir_prefix_
private

Definition at line 127 of file catalog_diff_tool.h.


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