CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
catalog::CatalogBalancer< CatalogMgrT >::VirtualNode Struct Reference
Collaboration diagram for catalog::CatalogBalancer< CatalogMgrT >::VirtualNode:

Public Member Functions

void ExtractChildren (CatalogMgrT *catalog_mgr)
 
void FixWeight ()
 
 VirtualNode (const std::string &path, CatalogMgrT *catalog_mgr)
 
 VirtualNode (const std::string &path, const DirectoryEntry &dirent, CatalogMgrT *catalog_mgr)
 
bool IsDirectory ()
 
bool IsCatalog ()
 

Public Attributes

std::vector< VirtualNodechildren
 
unsigned weight
 
DirectoryEntry dirent
 
std::string path
 
bool is_new_nested_catalog
 

Detailed Description

template<class CatalogMgrT>
struct catalog::CatalogBalancer< CatalogMgrT >::VirtualNode

A VirtualNode is the abstract representation of an entry in a catalog. It is used by the CatalogBalancer to "virtually" represent the file-system tree of a concrete catalog and spot the nodes where a new catalog should be created.

One of its main functions is to keep track of the current weight of a file or directory, i.e., the number of entries it contains. Concretely:

  • Normal files and symlinks: it is always one.
  • Normal directories: one plus the weight of each node it contains.
  • Directories which are catalog mount points: it is always one

Definition at line 94 of file catalog_balancer.h.

Constructor & Destructor Documentation

template<class CatalogMgrT>
catalog::CatalogBalancer< CatalogMgrT >::VirtualNode::VirtualNode ( const std::string &  path,
CatalogMgrT *  catalog_mgr 
)
inline

Definition at line 112 of file catalog_balancer.h.

template<class CatalogMgrT>
catalog::CatalogBalancer< CatalogMgrT >::VirtualNode::VirtualNode ( const std::string &  path,
const DirectoryEntry dirent,
CatalogMgrT *  catalog_mgr 
)
inline

Definition at line 117 of file catalog_balancer.h.

Here is the call graph for this function:

Member Function Documentation

template<class CatalogMgrT >
void catalog::CatalogBalancer< CatalogMgrT >::VirtualNode::ExtractChildren ( CatalogMgrT *  catalog_mgr)

Extracts not only the direct children of this VirtualNode, but recursively all the VirtualNodes of this catalog. When a VirtualNode that is the root of a nested catalog is created, it won't be expanded. In order to actually expand that node it will be necessary to manually call this method on it.

Parameters
catalog_mgrcatalog manager that contains the file system tree

Definition at line 165 of file catalog_balancer_impl.h.

Referenced by catalog::CatalogBalancer< CatalogMgrT >::Balance(), and catalog::CatalogBalancer< CatalogMgrT >::VirtualNode::VirtualNode().

Here is the caller graph for this function:

template<class CatalogMgrT >
void catalog::CatalogBalancer< CatalogMgrT >::VirtualNode::FixWeight ( )

This function is called in the father node when one of its children has changed its weight. This phenomenon only occurs when one of its children has become a new autogenerated nested catalog, and its weight is now 1 (which represents the sole DirectoryEntry of that directory). However this is not propagated to the top or the bottom of the tree, but each VirtualNode that represents a directory is responsible for calling it when previous operations might have changed the weight of its children (and consequently its own weight). This function is also called the first time this VirtualNodeit is used to set its weight to the actual value. Initially the weight of any VirtualNode is always 1.

Definition at line 191 of file catalog_balancer_impl.h.

Referenced by catalog::CatalogBalancer< CatalogMgrT >::PartitionOptimally().

Here is the caller graph for this function:

template<class CatalogMgrT>
bool catalog::CatalogBalancer< CatalogMgrT >::VirtualNode::IsCatalog ( )
inline

Definition at line 125 of file catalog_balancer.h.

Referenced by catalog::CatalogBalancer< CatalogMgrT >::MaxChild(), catalog::CatalogBalancer< CatalogMgrT >::PartitionOptimally(), and catalog::CatalogBalancer< CatalogMgrT >::VirtualNode::VirtualNode().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogMgrT>
bool catalog::CatalogBalancer< CatalogMgrT >::VirtualNode::IsDirectory ( )
inline

Definition at line 124 of file catalog_balancer.h.

Referenced by catalog::CatalogBalancer< CatalogMgrT >::MaxChild(), catalog::CatalogBalancer< CatalogMgrT >::PartitionOptimally(), and catalog::CatalogBalancer< CatalogMgrT >::VirtualNode::VirtualNode().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

template<class CatalogMgrT>
std::vector<VirtualNode> catalog::CatalogBalancer< CatalogMgrT >::VirtualNode::children

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