CernVM-FS
2.12.0
|
#include <catalog_diff_tool.h>
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 &) |
virtual bool | IsReportablePath (const PathString &) |
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::Catalog * | GetOldCatalog () const |
const catalog::Catalog * | GetNewCatalog () 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::DownloadManager * | download_manager_ |
perf::Statistics | stats_old_ |
perf::Statistics | stats_new_ |
UniquePtr< RaiiTempDir > | old_raii_temp_dir_ |
UniquePtr< RaiiTempDir > | new_raii_temp_dir_ |
UniquePtr< RoCatalogMgr > | old_catalog_mgr_ |
UniquePtr< RoCatalogMgr > | new_catalog_mgr_ |
const bool | needs_setup_ |
Definition at line 23 of file catalog_diff_tool.h.
|
inline |
Definition at line 25 of file catalog_diff_tool.h.
|
inline |
Definition at line 33 of file catalog_diff_tool.h.
|
inlinevirtual |
Definition at line 48 of file catalog_diff_tool.h.
|
private |
|
inlineprotected |
Definition at line 105 of file catalog_diff_tool.h.
|
inlineprotected |
Definition at line 111 of file catalog_diff_tool.h.
Referenced by receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::ReportModification().
|
inlineprotected |
Definition at line 102 of file catalog_diff_tool.h.
|
inlineprotected |
Definition at line 108 of file catalog_diff_tool.h.
bool CatalogDiffTool< RoCatalogMgr >::Init | ( | ) |
|
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.
|
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.
|
private |
Definition at line 84 of file catalog_diff_tool_impl.h.
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
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().
|
private |
Definition at line 129 of file catalog_diff_tool.h.
|
private |
Definition at line 140 of file catalog_diff_tool.h.
|
private |
Definition at line 138 of file catalog_diff_tool.h.
Referenced by CatalogDiffTool< catalog::SimpleCatalogManager >::GetNewCatalog(), and CatalogDiffTool< catalog::SimpleCatalogManager >::GetNewCatalogMgr().
|
private |
Definition at line 135 of file catalog_diff_tool.h.
|
private |
Definition at line 126 of file catalog_diff_tool.h.
|
private |
Definition at line 137 of file catalog_diff_tool.h.
Referenced by CatalogDiffTool< catalog::SimpleCatalogManager >::GetOldCatalog(), and CatalogDiffTool< catalog::SimpleCatalogManager >::GetOldCatalogMgr().
|
private |
Definition at line 134 of file catalog_diff_tool.h.
|
private |
Definition at line 125 of file catalog_diff_tool.h.
|
private |
Definition at line 124 of file catalog_diff_tool.h.
|
private |
Definition at line 132 of file catalog_diff_tool.h.
|
private |
Definition at line 131 of file catalog_diff_tool.h.
|
private |
Definition at line 127 of file catalog_diff_tool.h.