KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
KVDataSetManager Class Reference

Manage all datasets contained in a given data repository.

KVDataSetManager handles a collection of datasets contained in a data repository, which may be analysed with KaliVeda. The list of all known datasets is defined in $KVROOT/KVFiles/.kvrootrc. Some of these datasets may not be physically present in the repository. This is checked by method CheckAvailability(). This will search in the data repository for the subdirectories corresponding to each dataset, and afterwards KVDataSet::IsAvailable() will return kTRUE or kFALSE for each dataset depending on the result of the search.

ACTIVE DATA REPOSITORY/DATASET MANAGER

Each data repository has a data set manager. At any time, one repository is designated as being 'active' or 'current', and it's address is held in the global pointer gDataRepository. One can then access the corresponding dataset manager through gDataSetManager.

Definition at line 38 of file KVDataSetManager.h.

Public Member Functions

 KVDataSetManager ()
 
virtual ~ KVDataSetManager ()
 
virtual void CheckAvailability ()
 
virtual Bool_t CheckUser (const Char_t *groupname, const Char_t *username="")
 
KVDataAnalysisTaskGetAnalysisTaskAny (const Char_t *keywords) const
 
virtual KVDataSetGetAvailableDataSet (Int_t) const
 
KVDataSetGetDataSet (const Char_t *)
 Return pointer to DataSet using name. More...
 
KVDataSetGetDataSet (Int_t) const
 Return pointer to DataSet using index in list of all datasets, index>=0. More...
 
virtual Int_t GetNavailable () const
 
virtual Int_t GetNtotal () const
 
virtual KVDataAnalysisTaskGetTask (const Char_t *name)
 Return pointer to named data analysis task. More...
 
const KVNameValueListGetUserGroups ()
 
virtual Bool_t Init (KVDataRepository *=0)
 
virtual void Print (Option_t *opt="") const
 
virtual void Update ()
 

Protected Member Functions

virtual Bool_t CheckCacheStatus ()
 
const KVSeqCollectionGetAnalysisTaskList () const
 
virtual KVDataSetNewDataSet ()
 Creates and returns pointer to new data set object. More...
 
virtual Bool_t OpenAvailableDatasetsFile ()
 
virtual Bool_t ReadAvailableDatasetsFile ()
 
virtual Bool_t ReadDataSetList ()
 
virtual Bool_t ReadTaskList ()
 
virtual void ReadUserGroups ()
 

Protected Attributes

Bool_t fCacheAvailable
 kTRUE if caching is activated for parent repository More...
 
TString fCacheFileName
 name of cache file ( = [repository name].available.datasets) More...
 
std::ifstream fDatasets
 for reading cached repository available datasets file More...
 
KVUniqueNameList fDataSets
 list of datasets handled by manager More...
 
std::vector< Int_tfIndex
 array of indices of available datasets More...
 
UInt_t fMaxCacheTime
 maximum allowed age of cache file in seconds More...
 
Int_t fNavailable
 number of available datasets More...
 
KVDataRepositoryfRepository
 the repository for which data sets are handled More...
 
KVUniqueNameList fTasks
 list of all known analysis tasks More...
 
KVNameValueList fUserGroups
 list of user groups More...
 

Friends

class KVDataSet
 

#include <KVDataSetManager.h>

Inheritance diagram for KVDataSetManager:
Inheritance graph
[legend]

Constructor & Destructor Documentation

◆ KVDataSetManager()

KVDataSetManager::KVDataSetManager ( )

Definition at line 33 of file KVDataSetManager.cpp.

◆ ~ KVDataSetManager()

virtual KVDataSetManager::~ KVDataSetManager ( )
virtual

Member Function Documentation

◆ CheckAvailability()

void KVDataSetManager::CheckAvailability ( )
virtual

Check availability of datasets in repository associated to this data set manager

If caching is activated for the parent repository, i.e. if

[repository name].DataRepository.CacheAvailable: yes

then instead of directly checking the existence of the directories for each dataset, we use the cached information written in the file KVBase::WorkingRepository()/[repository name].available.datasets unless (1) it doesn't exist, or (2) the file is older than the maximum cache time (in seconds) defined by

[repository name].DataRepository.MaxCacheSeconds:

In either of these 2 cases, we check the existence of the directories and update/ create the cache file.

If the repository appears to be empty (perhaps because we are using a remote access protocol to check it, and the protocol has some problems...), then as a last resort we we will use the cache if it exists, whatever its age.

Reimplemented in KVRemoteDataSetManager.

Definition at line 279 of file KVDataSetManager.cpp.

◆ CheckCacheStatus()

Bool_t KVDataSetManager::CheckCacheStatus ( )
protectedvirtual

We check the status of the available datasets cache file. We return kTRUE if the file exists & was last modified less than fMaxCacheTime seconds ago.

Definition at line 585 of file KVDataSetManager.cpp.

◆ CheckUser()

Bool_t KVDataSetManager::CheckUser ( const Char_t groupname,
const Char_t username = "" 
)
virtual

Check in list of groups fUserGroups if the user name 'username' is part of the group 'groupname'. If 'username' is not given (default) we use current user info (gSystem->GetUserInof()->fUser).

Definition at line 431 of file KVDataSetManager.cpp.

◆ GetAnalysisTaskAny()

KVDataAnalysisTask * KVDataSetManager::GetAnalysisTaskAny ( const Char_t keywords) const

This method returns a pointer to the analysis task whose description (title) contains all of the whitespace-separated keywords (which may be regular expressions) given in the string "keywords". The comparison is case-insensitive. case-insensitive search for matches in list of all analysis tasks, based on 'title' attribute

Definition at line 622 of file KVDataSetManager.cpp.

◆ GetAnalysisTaskList()

const KVSeqCollection* KVDataSetManager::GetAnalysisTaskList ( ) const
inlineprotected

Definition at line 57 of file KVDataSetManager.h.

◆ GetAvailableDataSet()

KVDataSet * KVDataSetManager::GetAvailableDataSet ( Int_t  index) const
virtual

Return pointer to available DataSet using index of available datasets Note this index begins at 1, and corresponds to the number printed next to the dataset when Print("available") is called

Definition at line 404 of file KVDataSetManager.cpp.

◆ GetDataSet() [1/2]

KVDataSet * KVDataSetManager::GetDataSet ( const Char_t name)

Return pointer to DataSet using name.

Definition at line 391 of file KVDataSetManager.cpp.

◆ GetDataSet() [2/2]

KVDataSet * KVDataSetManager::GetDataSet ( Int_t  index) const

Return pointer to DataSet using index in list of all datasets, index>=0.

Definition at line 378 of file KVDataSetManager.cpp.

◆ GetNavailable()

virtual Int_t KVDataSetManager::GetNavailable ( ) const
inlinevirtual

Definition at line 78 of file KVDataSetManager.h.

◆ GetNtotal()

virtual Int_t KVDataSetManager::GetNtotal ( ) const
inlinevirtual

Definition at line 82 of file KVDataSetManager.h.

◆ GetTask()

KVDataAnalysisTask * KVDataSetManager::GetTask ( const Char_t name)
virtual

Return pointer to named data analysis task.

Definition at line 419 of file KVDataSetManager.cpp.

◆ GetUserGroups()

const KVNameValueList& KVDataSetManager::GetUserGroups ( )
inline

Definition at line 86 of file KVDataSetManager.h.

◆ Init()

Bool_t KVDataSetManager::Init ( KVDataRepository dr = 0)
virtual

Initialisation of dataset manager for the repository 'dr'. If dr=0x0 (default) then all known datasets are 'available', otherwise we check availability of datasets based on data present in repository. Initialise all possible data analysis tasks, then set list of possible tasks for each available dataset.

Returns kTRUE if all goes well. For remote data repositories we return kFALSE if no datasets are available (as the access to these is read-only)

Definition at line 65 of file KVDataSetManager.cpp.

◆ NewDataSet()

KVDataSet * KVDataSetManager::NewDataSet ( )
protectedvirtual

Creates and returns pointer to new data set object.

Definition at line 453 of file KVDataSetManager.cpp.

◆ OpenAvailableDatasetsFile()

Bool_t KVDataSetManager::OpenAvailableDatasetsFile ( )
protectedvirtual

Opens file KVBase::WorkingDirectory()/[repository name].available.datasets containing cached info on available datasets and associated subdirectories in data repository. Opens file for reading, & if all goes well returns kTRUE. Returns kFALSE in case of problems.

Reimplemented in KVRemoteDataSetManager.

Definition at line 492 of file KVDataSetManager.cpp.

◆ Print()

void KVDataSetManager::Print ( Option_t opt = "") const
virtual

Print list of datasets If opt="" (default) all datasets are shown with full information if opt="available" only available datasets are shown, each with a number which can be used with GetAvailableDataSet(Int_t) in order to retrieve the corresponding dataset.

Definition at line 224 of file KVDataSetManager.cpp.

◆ ReadAvailableDatasetsFile()

Bool_t KVDataSetManager::ReadAvailableDatasetsFile ( )
protectedvirtual

Opens and reads file containing cached info on available datasets, and sets the availability of the concerned datasets. Returns kTRUE if all goes well. Returns kFALSE if no cache exists or if file cannot be opened.

Definition at line 511 of file KVDataSetManager.cpp.

◆ ReadDataSetList()

Bool_t KVDataSetManager::ReadDataSetList ( )
protectedvirtual

Initialise list of all known datasets from informations in $KVROOT/KVFIles/.kvrootrc (and user's .kvrootrc)

Definition at line 153 of file KVDataSetManager.cpp.

◆ ReadTaskList()

Bool_t KVDataSetManager::ReadTaskList ( )
protectedvirtual

Initialise list of all known analysis tasks from informations in $KVROOT/KVFIles/.kvrootrc (and user's .kvrootrc)

Definition at line 188 of file KVDataSetManager.cpp.

◆ ReadUserGroups()

void KVDataSetManager::ReadUserGroups ( )
protectedvirtual

Sets up list of user groups defining restricted access to certain datasets. Definition of different user groups is given in $KVROOT/KVFiles/.kvrootrc UserGroups env var contains whitespace-separated list of group names

Definition at line 120 of file KVDataSetManager.cpp.

◆ Update()

void KVDataSetManager::Update ( )
virtual

Called when the physical state of the repository has changed i.e. a subdirectory for a new dataset or datatype has been added or removed. We update the available datatsets, datatypes and analysis tasks. check which datasets are available

Definition at line 467 of file KVDataSetManager.cpp.

Friends And Related Function Documentation

◆ KVDataSet

friend class KVDataSet
friend

Definition at line 40 of file KVDataSetManager.h.

Member Data Documentation

◆ fCacheAvailable

Bool_t KVDataSetManager::fCacheAvailable
protected

kTRUE if caching is activated for parent repository

Definition at line 63 of file KVDataSetManager.h.

◆ fCacheFileName

TString KVDataSetManager::fCacheFileName
protected

name of cache file ( = [repository name].available.datasets)

Definition at line 65 of file KVDataSetManager.h.

◆ fDatasets

std::ifstream KVDataSetManager::fDatasets
protected

for reading cached repository available datasets file

Definition at line 43 of file KVDataSetManager.h.

◆ fDataSets

KVUniqueNameList KVDataSetManager::fDataSets
protected

list of datasets handled by manager

Definition at line 44 of file KVDataSetManager.h.

◆ fIndex

std::vector<Int_t> KVDataSetManager::fIndex
protected

array of indices of available datasets

Definition at line 47 of file KVDataSetManager.h.

◆ fMaxCacheTime

UInt_t KVDataSetManager::fMaxCacheTime
protected

maximum allowed age of cache file in seconds

Definition at line 64 of file KVDataSetManager.h.

◆ fNavailable

Int_t KVDataSetManager::fNavailable
protected

number of available datasets

Definition at line 46 of file KVDataSetManager.h.

◆ fRepository

KVDataRepository* KVDataSetManager::fRepository
protected

the repository for which data sets are handled

Definition at line 55 of file KVDataSetManager.h.

◆ fTasks

KVUniqueNameList KVDataSetManager::fTasks
protected

list of all known analysis tasks

Definition at line 45 of file KVDataSetManager.h.

◆ fUserGroups

KVNameValueList KVDataSetManager::fUserGroups
protected

list of user groups

Definition at line 48 of file KVDataSetManager.h.


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