ldas-tools-diskcacheAPI 2.7.7
Classes | Public Types | Static Public Member Functions | Static Private Attributes | List of all members
diskCache::Cache::HotDirectory Class Reference

Information about a directory that is being actively watched. More...

#include <HotDirectory.hh>

Classes

class  UnaryFunction
 Base for unary functions to be used in ForEach call. More...
 

Public Types

typedef DirectoryManager directory_set_type
 
typedef boost::shared_ptr< Directoryshared_dir_info_type
 Storage type for directory information. More...
 
typedef boost::weak_ptr< shared_dir_info_type::element_type > weak_dir_info_type
 Storage type for directory information. More...
 
typedef Directory::timestamp_type timestamp_type
 
typedef DirectoryManager directory_set_type
 
typedef boost::shared_ptr< Directoryshared_dir_info_type
 Storage type for directory information. More...
 
typedef boost::weak_ptr< shared_dir_info_type::element_type > weak_dir_info_type
 Storage type for directory information. More...
 
typedef Directory::timestamp_type timestamp_type
 
typedef DirectoryManager directory_set_type
 
typedef boost::shared_ptr< Directoryshared_dir_info_type
 Storage type for directory information. More...
 
typedef boost::weak_ptr< shared_dir_info_type::element_type > weak_dir_info_type
 Storage type for directory information. More...
 
typedef Directory::timestamp_type timestamp_type
 

Static Public Member Functions

static void ForEach (UnaryFunction &Func)
 Iterate over each hot directory. More...
 
static timestamp_type HotLowerBound ()
 Lower bound of relative age in seconds to be considered. More...
 
static void HotLowerBound (timestamp_type Value)
 Set lower bound of relative age in seconds to be considered. More...
 
static bool IsRegistered (const std::string &Path)
 Report if the path is registered as hot. More...
 
static void RegisterIfHot (weak_dir_info_type Entry, const directory_set_type &Manager, bool Log)
 Add a directory to the list of hot directories. More...
 
static void Reset ()
 Clear the cache. More...
 
static void ScanInterval (timestamp_type Value)
 Establish the frequency that hot directories are scanned. More...
 
static timestamp_type ScanInterval ()
 The frequency that hot directories are scanned. More...
 
static void StopDaemon ()
 Shutdown daemon which is scanning the list of hot directories. More...
 
static void Unregister (weak_dir_info_type Entry)
 Remove a directory from the list of hot directories. More...
 
static void ForEach (UnaryFunction &Func)
 Iterate over each hot directory. More...
 
static timestamp_type HotLowerBound ()
 Lower bound of relative age in seconds to be considered. More...
 
static void HotLowerBound (timestamp_type Value)
 Set lower bound of relative age in seconds to be considered. More...
 
static bool IsRegistered (const std::string &Path)
 Report if the path is registered as hot. More...
 
static void RegisterIfHot (weak_dir_info_type Entry, const directory_set_type &Manager, bool Log)
 Add a directory to the list of hot directories. More...
 
static void Reset ()
 Clear the cache. More...
 
static void ScanInterval (timestamp_type Value)
 Establish the frequency that hot directories are scanned. More...
 
static timestamp_type ScanInterval ()
 The frequency that hot directories are scanned. More...
 
static void StopDaemon ()
 Shutdown daemon which is scanning the list of hot directories. More...
 
static void Unregister (weak_dir_info_type Entry)
 Remove a directory from the list of hot directories. More...
 
static void ForEach (UnaryFunction &Func)
 Iterate over each hot directory. More...
 
static timestamp_type HotLowerBound ()
 Lower bound of relative age in seconds to be considered. More...
 
static void HotLowerBound (timestamp_type Value)
 Set lower bound of relative age in seconds to be considered. More...
 
static bool IsRegistered (const std::string &Path)
 Report if the path is registered as hot. More...
 
static void RegisterIfHot (weak_dir_info_type Entry, const directory_set_type &Manager, bool Log)
 Add a directory to the list of hot directories. More...
 
static void Reset ()
 Clear the cache. More...
 
static void ScanInterval (timestamp_type Value)
 Establish the frequency that hot directories are scanned. More...
 
static timestamp_type ScanInterval ()
 The frequency that hot directories are scanned. More...
 
static void StopDaemon ()
 Shutdown daemon which is scanning the list of hot directories. More...
 
static void Unregister (weak_dir_info_type Entry)
 Remove a directory from the list of hot directories. More...
 

Static Private Attributes

static timestamp_type m_lower_bound = 300
 Storage for lower bound of relative age in seconds. More...
 
static timestamp_type m_scan_interval = 4
 Number of seconds between scans. More...
 

Detailed Description

Information about a directory that is being actively watched.

This maintains a collection of hot directories. Hot directories are scanned outside of the conventional deep scan of the MountPoint class so as to reduce discovery latency.

Member Typedef Documentation

◆ directory_set_type [1/3]

◆ directory_set_type [2/3]

◆ directory_set_type [3/3]

◆ shared_dir_info_type [1/3]

Storage type for directory information.

Storage of the directory information allowing for reference counting so as to protect the memory being referenced to stay within scope till all consumers have completed their use of of the data.

◆ shared_dir_info_type [2/3]

Storage type for directory information.

Storage of the directory information allowing for reference counting so as to protect the memory being referenced to stay within scope till all consumers have completed their use of of the data.

◆ shared_dir_info_type [3/3]

Storage type for directory information.

Storage of the directory information allowing for reference counting so as to protect the memory being referenced to stay within scope till all consumers have completed their use of of the data.

◆ timestamp_type [1/3]

◆ timestamp_type [2/3]

◆ timestamp_type [3/3]

◆ weak_dir_info_type [1/3]

typedef boost::weak_ptr< shared_dir_info_type::element_type > diskCache::Cache::HotDirectory::weak_dir_info_type

Storage type for directory information.

Having the directory information stored in a shared pointer container increases thread safety and diminishes the needs for locks.

◆ weak_dir_info_type [2/3]

typedef boost::weak_ptr< shared_dir_info_type::element_type > diskCache::Cache::HotDirectory::weak_dir_info_type

Storage type for directory information.

Having the directory information stored in a shared pointer container increases thread safety and diminishes the needs for locks.

◆ weak_dir_info_type [3/3]

typedef boost::weak_ptr< shared_dir_info_type::element_type > diskCache::Cache::HotDirectory::weak_dir_info_type

Storage type for directory information.

Having the directory information stored in a shared pointer container increases thread safety and diminishes the needs for locks.

Member Function Documentation

◆ ForEach() [1/3]

void diskCache::Cache::HotDirectory::ForEach ( HotDirectory::UnaryFunction Func)
static

Iterate over each hot directory.

Parameters
[in]FuncFunction to execute.

◆ ForEach() [2/3]

static void diskCache::Cache::HotDirectory::ForEach ( UnaryFunction Func)
static

Iterate over each hot directory.

Parameters
[in]FuncFunction to execute.

◆ ForEach() [3/3]

static void diskCache::Cache::HotDirectory::ForEach ( UnaryFunction Func)
static

Iterate over each hot directory.

Parameters
[in]FuncFunction to execute.

◆ HotLowerBound() [1/6]

timestamp_type diskCache::Cache::HotDirectory::HotLowerBound ( )
static

Lower bound of relative age in seconds to be considered.

Returns
The current lower bound.

Return the time representing the lower bounds of what should be considered hot.

◆ HotLowerBound() [2/6]

static timestamp_type diskCache::Cache::HotDirectory::HotLowerBound ( )
static

Lower bound of relative age in seconds to be considered.

Returns
The current lower bound.

◆ HotLowerBound() [3/6]

static timestamp_type diskCache::Cache::HotDirectory::HotLowerBound ( )
static

Lower bound of relative age in seconds to be considered.

Returns
The current lower bound.

◆ HotLowerBound() [4/6]

void diskCache::Cache::HotDirectory::HotLowerBound ( timestamp_type  Value)
static

Set lower bound of relative age in seconds to be considered.

Parameters
[in]ValueThe new lower bound. A value of 0 (zero) disables hot directories.

Establish the time representing the lower bounds of what should be considered hot.

◆ HotLowerBound() [5/6]

static void diskCache::Cache::HotDirectory::HotLowerBound ( timestamp_type  Value)
static

Set lower bound of relative age in seconds to be considered.

Parameters
[in]ValueThe new lower bound. A value of 0 (zero) disables hot directories.

◆ HotLowerBound() [6/6]

static void diskCache::Cache::HotDirectory::HotLowerBound ( timestamp_type  Value)
static

Set lower bound of relative age in seconds to be considered.

Parameters
[in]ValueThe new lower bound. A value of 0 (zero) disables hot directories.

◆ IsRegistered() [1/3]

bool diskCache::Cache::HotDirectory::IsRegistered ( const std::string &  Path)
static

Report if the path is registered as hot.

Parameters
[in]PathThe path to check.

This method simply reports if a directory is in the collection of directories that are scanned at a higher rate as they appear to be actively filling with new files.

◆ IsRegistered() [2/3]

static bool diskCache::Cache::HotDirectory::IsRegistered ( const std::string &  Path)
static

Report if the path is registered as hot.

Parameters
[in]PathThe path to check.

◆ IsRegistered() [3/3]

static bool diskCache::Cache::HotDirectory::IsRegistered ( const std::string &  Path)
static

Report if the path is registered as hot.

Parameters
[in]PathThe path to check.

◆ RegisterIfHot() [1/3]

void diskCache::Cache::HotDirectory::RegisterIfHot ( weak_dir_info_type  Entry,
const directory_set_type Manager,
bool  Log 
)
static

Add a directory to the list of hot directories.

Parameters
[in]EntryThe Entry to add to the list of hot directories if and only if it meets all hot directory criteria.
[in]ManagerDirectory set.
[in]LogSet to true if the directory should log a message if Entry is added to the hot list.

Checks to see if the directory has been modified within the time range to be considered hot. Directories found to be hot are added to the list of hot directories and are scanned more frequently.

◆ RegisterIfHot() [2/3]

static void diskCache::Cache::HotDirectory::RegisterIfHot ( weak_dir_info_type  Entry,
const directory_set_type Manager,
bool  Log 
)
static

Add a directory to the list of hot directories.

Parameters
[in]EntryThe Entry to add to the list of hot directories if and only if it meets all hot directory criteria.
[in]ManagerDirectory set.
[in]LogSet to true if the directory should log a message if Entry is added to the hot list.

◆ RegisterIfHot() [3/3]

static void diskCache::Cache::HotDirectory::RegisterIfHot ( weak_dir_info_type  Entry,
const directory_set_type Manager,
bool  Log 
)
static

Add a directory to the list of hot directories.

Parameters
[in]EntryThe Entry to add to the list of hot directories if and only if it meets all hot directory criteria.
[in]ManagerDirectory set.
[in]LogSet to true if the directory should log a message if Entry is added to the hot list.

◆ Reset() [1/3]

void diskCache::Cache::HotDirectory::Reset ( )
static

Clear the cache.

This returns the cache to an empty state.

◆ Reset() [2/3]

static void diskCache::Cache::HotDirectory::Reset ( )
static

Clear the cache.

This returns the cache to an empty state.

◆ Reset() [3/3]

static void diskCache::Cache::HotDirectory::Reset ( )
static

Clear the cache.

This returns the cache to an empty state.

◆ ScanInterval() [1/6]

HotDirectory::timestamp_type diskCache::Cache::HotDirectory::ScanInterval ( )
inlinestatic

The frequency that hot directories are scanned.

Returns
The scan interval.

Return the time representing the number of seconds to sleep between scans of the set of hot directories.

◆ ScanInterval() [2/6]

static timestamp_type diskCache::Cache::HotDirectory::ScanInterval ( )
static

The frequency that hot directories are scanned.

Returns
The scan interval.

◆ ScanInterval() [3/6]

static timestamp_type diskCache::Cache::HotDirectory::ScanInterval ( )
static

The frequency that hot directories are scanned.

Returns
The scan interval.

◆ ScanInterval() [4/6]

void diskCache::Cache::HotDirectory::ScanInterval ( timestamp_type  Value)
static

Establish the frequency that hot directories are scanned.

Parameters
[in]ValueThe new scan interval.

Establish the time representing the number of seconds to sleep between scans of the set of hot directories.

◆ ScanInterval() [5/6]

static void diskCache::Cache::HotDirectory::ScanInterval ( timestamp_type  Value)
static

Establish the frequency that hot directories are scanned.

Parameters
[in]ValueThe new scan interval.

◆ ScanInterval() [6/6]

static void diskCache::Cache::HotDirectory::ScanInterval ( timestamp_type  Value)
static

Establish the frequency that hot directories are scanned.

Parameters
[in]ValueThe new scan interval.

◆ StopDaemon() [1/3]

void diskCache::Cache::HotDirectory::StopDaemon ( )
static

Shutdown daemon which is scanning the list of hot directories.

◆ StopDaemon() [2/3]

static void diskCache::Cache::HotDirectory::StopDaemon ( )
static

Shutdown daemon which is scanning the list of hot directories.

◆ StopDaemon() [3/3]

static void diskCache::Cache::HotDirectory::StopDaemon ( )
static

Shutdown daemon which is scanning the list of hot directories.

◆ Unregister() [1/3]

void diskCache::Cache::HotDirectory::Unregister ( weak_dir_info_type  Entry)
static

Remove a directory from the list of hot directories.

Parameters
[in]EntryThe Entry to be removed from the list of hot directories.

◆ Unregister() [2/3]

static void diskCache::Cache::HotDirectory::Unregister ( weak_dir_info_type  Entry)
static

Remove a directory from the list of hot directories.

Parameters
[in]EntryThe Entry to be removed from the list of hot directories.

◆ Unregister() [3/3]

static void diskCache::Cache::HotDirectory::Unregister ( weak_dir_info_type  Entry)
static

Remove a directory from the list of hot directories.

Parameters
[in]EntryThe Entry to be removed from the list of hot directories.

Member Data Documentation

◆ m_lower_bound

static timestamp_type diskCache::Cache::HotDirectory::m_lower_bound = 300
staticprivate

Storage for lower bound of relative age in seconds.

A directory that has been modified within this number of seconds is considered to be hot.

The default value is 300 seconds ( 5 minutes ).

◆ m_scan_interval

static timestamp_type diskCache::Cache::HotDirectory::m_scan_interval = 4
staticprivate

Number of seconds between scans.

This value regulates the number of seconds between scans of the collection hot directories.


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