ldas-tools-diskcacheAPI  2.7.2
Classes | Namespaces | Typedefs | Functions
diskcachecmd.cc File Reference
#include <sys/time.h>
#include <time.h>
#include <iostream>
#include <iomanip>
#include <list>
#include "diskcache.hh"
#include "diskcachecmd.hh"
#include "ldastoolsal/MemChecker.hh"
#include "ldastoolsal/ConditionalVariable.hh"
#include "ldastoolsal/fstream.hh"
#include "ldastoolsal/ldasexception.hh"
#include "ldastoolsal/Task.hh"
#include "genericAPI/Logging.hh"
#include "diskcacheAPI/Cache/ExcludedDirectoriesSingleton.hh"
#include "diskcacheAPI/Streams/ASCII.hh"
#include "diskcacheAPI/Streams/Binary.hh"
#include "diskcacheAPI/Streams/FStream.hh"
#include "diskcacheAPI/Cache/Directory.hh"
#include "diskcacheAPI/Cache/QueryAnswer.hh"
#include "diskcacheAPI/Cache/QueryParams.hh"
#include "diskcacheAPI/Cache/RegistrySingleton.hh"
#include "diskcacheAPI/Cache/SDGTx.hh"
#include "AtomicFile.hh"
#include "Daemons.hh"
#include "DirectoryManagerSingleton.hh"
#include "MountPointScanner.hh"
Include dependency graph for diskcachecmd.cc:

Classes

class  anonymous_namespace{diskcachecmd.cc}::Timer
 Debug utility to track down execution time. More...
 

Namespaces

 anonymous_namespace{diskcachecmd.cc}
 

Typedefs

typedef diskCache::MountPointScanner::mount_point_container_type anonymous_namespace{diskcachecmd.cc}::mount_point_container_type
 

Functions

void anonymous_namespace{diskcachecmd.cc}::is_first_scan_complete (const char *const File, int Line)
 
std::string anonymous_namespace{diskcachecmd.cc}::ms_format (const LDASTools::AL::GPSTime &DT)
 
void getHashNumbers (diskCache::Cache::QueryAnswer &Answer, const char *Ifo, const char *Type)
 Get sets of counts for each directory. More...
 
void getIntervalsList (diskCache::Cache::QueryAnswer &Answer, const char *ifo_type_str, const INT_4U query_start, const INT_4U query_stop, const std::string &Extension)
 Get TCL formatted lists of intervals for data matching the specified and Type within the bounds of the query. More...
 
void writeDirCache (const char *filename, diskCache::Streams::Interface::version_type Version)
 param: const char* filename - Name of the file to write frame hash to. More...
 
void writeDirCacheAscii (const char *filename, diskCache::Streams::Interface::version_type Version)
 param: const char* filename - Name of the file to write frame hash to. More...
 
void writeDirCacheFiles (const char *bfilename, const char *afilename)
 Write content of global frame data hash to ascii file. More...
 
void CacheRead (const char *filename)
 param: const char* filename - Name of the file to read frame hash from. More...
 
string excludedDirList (const ExcludedDirectoriesSingleton::directory_container_type &DirectoryList)
 usage: set dir_list [ excludedDirList dirs_to_exclude ] More...
 
void deleteDirCache ()
 return: Nothing. More...
 
void ScanConcurrency (INT_4U Concurrency)
 This routine does a single pass of the listed mount points. More...
 
void ScanMountPointList (MountPointScanner::ScanResults &Answer)
 This routine does a single pass of the listed mount points. More...
 
void DumpCacheDaemonStart ()
 Create an image of the cache file on the storage media. More...
 
void DumpCacheDaemonStop ()
 stop the currently running Dump Cache Daemon More...
 
void ScanMountPointListContinuously ()
 Scan the list of mount points in the background. More...
 
void ScanMountPointListContinuouslyStop ()
 Bring the scanner to a close. More...
 

Function Documentation

◆ CacheRead()

void CacheRead ( const char *  filename)

param: const char* filename - Name of the file to read frame hash from.

return: Nothing.

◆ deleteDirCache()

void deleteDirCache ( )

return: Nothing.

◆ DumpCacheDaemonStart()

void DumpCacheDaemonStart ( )

Create an image of the cache file on the storage media.

◆ DumpCacheDaemonStop()

void DumpCacheDaemonStop ( )

stop the currently running Dump Cache Daemon

◆ excludedDirList()

string excludedDirList ( const ExcludedDirectoriesSingleton::directory_container_type DirectoryList)

usage: set dir_list [ excludedDirList dirs_to_exclude ]

param: const CHAR* dir_list - A list of directories to exclude (as they return: string - Sorted Tcl list of all removed subdirectories, followed

◆ getHashNumbers()

void getHashNumbers ( diskCache::Cache::QueryAnswer Answer,
const char *  Ifo,
const char *  Type 
)

Get sets of counts for each directory.

Get TCL formatted lists for each mount point with name or mount point, number of directories and number of files for data matching the specified ifo and type. Return lists are of the form: {mountpoint_name number_of_dirs number_of_files }

Parameters
[out]AnswerResulting hash numbers based on query parameters.
[in]IfoAn ifo to look up. Default is "all".
[in]TypeA type to look up. Default is "all".
Returns
A list for each mount point with name, number of directories and number of files under that mount point: {mountpoint_name number_of_dirs number_of files }
Todo:
Need to get getHashNumber queries working

◆ getIntervalsList()

void getIntervalsList ( diskCache::Cache::QueryAnswer Answer,
const char *  ifo_type_str,
const INT_4U  query_start,
const INT_4U  query_stop,
const std::string &  Extension 
)

Get TCL formatted lists of intervals for data matching the specified and Type within the bounds of the query.

Parameters
[out]AnswerMatching intervals based on query parameters.
[in]ifo_type_strA space delimited list of IFO-Type strings
[in]query_startQuery start time.
[in]query_stopQuery stop time.
[in]ExtensionFilename extension
Returns
A list for each IFO-Type with data intervals: IFO-Type1 { i1_start i1_stop ... iN_start iN_stop } ... IFO-TypeN { ... }

◆ ScanConcurrency()

void ScanConcurrency ( INT_4U  Concurrency)

This routine does a single pass of the listed mount points.

The number of mount point directories to scan concurrently.

◆ ScanMountPointList()

void ScanMountPointList ( MountPointScanner::ScanResults Answer)

This routine does a single pass of the listed mount points.

Scan the list of mount points.

Obtain the list of mount points.

The output needs to be in the following format 7 mount points, 0 directories, 0 files, scanned in 3010 ms (00:00:03.0010).

Todo:
Complete the population of the status message

◆ ScanMountPointListContinuously()

void ScanMountPointListContinuously ( )

Scan the list of mount points in the background.

Continuously scan the list of mount points.

◆ ScanMountPointListContinuouslyStop()

void ScanMountPointListContinuouslyStop ( )

Bring the scanner to a close.

◆ writeDirCache()

void writeDirCache ( const char *  filename,
diskCache::Streams::Interface::version_type  Version 
)

param: const char* filename - Name of the file to write frame hash to.

return: Nothing.

◆ writeDirCacheAscii()

void writeDirCacheAscii ( const char *  filename,
diskCache::Streams::Interface::version_type  Version 
)

param: const char* filename - Name of the file to write frame hash to.

return: Nothing.

◆ writeDirCacheFiles()

void writeDirCacheFiles ( const char *  bfilename,
const char *  afilename 
)

Write content of global frame data hash to ascii file.

return: Nothing.

Parameters
[in]bfilenameName of the file to write the binary frame hash to. Default is NULL (C++ will use default file name).
[in]afilenameName of the file to write the ascii frame hash to. Default is NULL (C++ will use default file name).