ldas-tools-diskcacheAPI  2.5.6
Classes | Public Types | Static Public Member Functions | 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 LDASTools::AL::SharedPtr< Directoryshared_dir_info_type
 Storage type for directory information. More...
 
typedef LDASTools::AL::WeakPtr< 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...
 

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

◆ shared_dir_info_type

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

◆ weak_dir_info_type

typedef LDASTools::AL::WeakPtr< 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()

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

Iterate over each hot directory.

Parameters
[in]FuncFunction to execute.

◆ HotLowerBound() [1/2]

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/2]

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.

◆ IsRegistered()

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.

◆ RegisterIfHot()

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.

◆ Reset()

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

Clear the cache.

This returns the cache to an empty state.

◆ ScanInterval() [1/2]

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() [2/2]

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.

◆ StopDaemon()

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

Shutdown daemon which is scanning the list of hot directories.

◆ Unregister()

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.

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