CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
publish::SyncUnionAufs Class Reference

#include <sync_union_aufs.h>

Inheritance diagram for publish::SyncUnionAufs:
Collaboration diagram for publish::SyncUnionAufs:

Public Member Functions

 SyncUnionAufs (SyncMediator *mediator, const std::string &rdonly_path, const std::string &union_path, const std::string &scratch_path)
 
void Traverse ()
 
bool SupportsHardlinks () const
 
- Public Member Functions inherited from publish::SyncUnion
 SyncUnion (AbstractSyncMediator *mediator, const std::string &rdonly_path, const std::string &union_path, const std::string &scratch_path)
 
virtual ~SyncUnion ()
 
virtual bool Initialize ()
 
virtual void PostUpload ()
 
SharedPtr< SyncItemCreateSyncItem (const std::string &relative_parent_path, const std::string &filename, const SyncItemType entry_type) const
 
std::string rdonly_path () const
 
std::string union_path () const
 
std::string scratch_path () const
 
bool IsInitialized () const
 

Protected Member Functions

bool IsWhiteoutEntry (SharedPtr< SyncItem > entry) const
 
bool IsOpaqueDirectory (SharedPtr< SyncItem > directory) const
 
bool IgnoreFilePredicate (const std::string &parent_dir, const std::string &filename)
 
std::string UnwindWhiteoutFilename (SharedPtr< SyncItem > entry) const
 
- Protected Member Functions inherited from publish::SyncUnion
virtual void PreprocessSyncItem (SharedPtr< SyncItem > entry) const
 
virtual void ProcessRegularFile (const std::string &parent_dir, const std::string &filename)
 
virtual bool ProcessDirectory (const std::string &parent_dir, const std::string &dir_name)
 
virtual bool ProcessDirectory (SharedPtr< SyncItem > entry)
 
virtual bool ProcessUnmaterializedDirectory (SharedPtr< SyncItem > entry)
 
virtual void ProcessSymlink (const std::string &parent_dir, const std::string &link_name)
 
virtual void EnterDirectory (const std::string &parent_dir, const std::string &dir_name)
 
virtual void LeaveDirectory (const std::string &parent_dir, const std::string &dir_name)
 
void ProcessCharacterDevice (const std::string &parent_dir, const std::string &filename)
 
void ProcessBlockDevice (const std::string &parent_dir, const std::string &filename)
 
void ProcessFifo (const std::string &parent_dir, const std::string &filename)
 
void ProcessSocket (const std::string &parent_dir, const std::string &filename)
 
void ProcessFile (SharedPtr< SyncItem > entry)
 

Private Attributes

std::set< std::string > ignore_filenames_
 
std::string whiteout_prefix_
 

Additional Inherited Members

- Protected Attributes inherited from publish::SyncUnion
std::string rdonly_path_
 
std::string scratch_path_
 
std::string union_path_
 
AbstractSyncMediatormediator_
 

Detailed Description

Syncing a cvmfs repository by the help of an overlayed AUFS read-write volume.

Definition at line 22 of file sync_union_aufs.h.

Constructor & Destructor Documentation

publish::SyncUnionAufs::SyncUnionAufs ( SyncMediator mediator,
const std::string &  rdonly_path,
const std::string &  union_path,
const std::string &  scratch_path 
)

Definition at line 17 of file sync_union_aufs.cc.

Member Function Documentation

bool publish::SyncUnionAufs::IgnoreFilePredicate ( const std::string &  parent_dir,
const std::string &  filename 
)
protectedvirtual

Union file systems may use some special files for bookkeeping. They must not show up in to repository and are ignored by the recursion. Note: This needs to be up-called!

Parameters
parentdirectory in which file resides
filenameto decide whether to ignore or not
Returns
true if file should be ignored, othewise false

Reimplemented from publish::SyncUnion.

Definition at line 70 of file sync_union_aufs.cc.

Referenced by Traverse().

Here is the call graph for this function:

Here is the caller graph for this function:

bool publish::SyncUnionAufs::IsOpaqueDirectory ( SharedPtr< SyncItem directory) const
protectedvirtual

Union file systems use opaque directories to fully support rmdir e.g: $ rm -rf directory $ mkdir directory This would produce an opaque directory whose contents are NOT merged with the underlying directory in the read-only branch

Parameters
directorythe directory to check for opacity
Returns
true if directory is opaque, otherwise false

Implements publish::SyncUnion.

Definition at line 61 of file sync_union_aufs.cc.

Here is the call graph for this function:

bool publish::SyncUnionAufs::IsWhiteoutEntry ( SharedPtr< SyncItem entry) const
protectedvirtual

Checks if given file is supposed to be whiteout. These files indicate that a specific file has been deleted.

Parameters
filenamethe filename to check
Returns
true if filename seems to be whiteout otherwise false

Implements publish::SyncUnion.

Definition at line 56 of file sync_union_aufs.cc.

bool publish::SyncUnionAufs::SupportsHardlinks ( ) const
inlinevirtual

Reimplemented from publish::SyncUnion.

Definition at line 28 of file sync_union_aufs.h.

void publish::SyncUnionAufs::Traverse ( )
virtual

Main routine, process scratch space

Implements publish::SyncUnion.

Definition at line 33 of file sync_union_aufs.cc.

Here is the call graph for this function:

string publish::SyncUnionAufs::UnwindWhiteoutFilename ( SharedPtr< SyncItem entry) const
protectedvirtual

Whiteout files may have special naming conventions. This method "unmangles" them and retrieves the original file name

Parameters
filenamethe filename as in the scratch directory
Returns
the original filename of the scratched out file in CVMFS repository

Implements publish::SyncUnion.

Definition at line 65 of file sync_union_aufs.cc.

Member Data Documentation

std::set<std::string> publish::SyncUnionAufs::ignore_filenames_
private

Definition at line 38 of file sync_union_aufs.h.

Referenced by IgnoreFilePredicate(), and SyncUnionAufs().

std::string publish::SyncUnionAufs::whiteout_prefix_
private

Definition at line 39 of file sync_union_aufs.h.

Referenced by IsWhiteoutEntry(), SyncUnionAufs(), and UnwindWhiteoutFilename().


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