The ROOT based implementation of the CDB and CfgDB requires to translate a
generic file name --> logical file name (LFN)and
logical file name (LFN) --> physical file name (PFN)A client, for example, would request a CDB root file using a generic name that is not attached to a particular snapshot. Using a rule this generic name is translated into a logical file name and this file is of a particular snapshot. In order to open the file the second step translates the logical name into a physical name which coul be a path in nfs or xrootd.
The translation from LFN to PFN is done by the KanAccess.cfg using the same mechanism used for the event-store root files.
The translation from a generic name to the LFN is new for the nonevent-store files. The rules how to translate the names are stored in (name rules) config files. For the CDB this file is CdbNameRules.cfg and for the CfgDB it is CfgDBNameRules.cfg
This example shows the different names for a CDB snapshot file:generic name: cdb_o259_c0_p7_i0.root LFN: /store/cdb/cond18boot/betamini/2006/04/20060419T091147/CDB-20060419T091147-cdb_o259_c0_p7_i0.root PFN: xrootd://rdr-a////store/cdb/cond18boot/betamini/2006/04/20060419T091147/CDB-20060419T091147-cdb_o259_c0_p7_i0.root
# CfgDB read /store/cfg/* xrootd kanolb-a:1094/ write /store/cfg/* error # CDB read /store/cdb/* xrootd kanolb-a:1094/ write /store/cdb/* errorIf you prefer to access the database using the ordinary file system, then it might look like:
# CfgDB read /store/cfg/* file /work/cfgdb-root write /store/cfg/* error #CDB read /store/cdb/* file /work/cdb-root write /store/cdb/* errorTo check that it works as expected run the following command:
> KanAccess /store/cfg/CfgDB.rootIts output should print the path to the intended storage space, either xrootd or a file system directory.
$BFROOT/kanga/config/cfgdb/CfgDBNameRules.cfgwith the following content (or copy it from SLAC):
# we don't allow writing to a generic DB write /cfg/CfgDB\.root error # generic name translation for the most recent snapshot -include kanga/config/cfgdb/CfgDBNameRules-latest.cfg
As you can see this file has an include statement for another file (CfgDBNameRules-latest.cfg, the path is relative to $BFROOT). This file is usually a link to a file that is specific to a snapshot. For example
CfgDBNameRules-latest.cfg -> CfgDBNameRules-20060425T183631.cfgwith
> cat CfgDBNameRules-20060425T183631.cfg read /cfg/CfgDB\.root /store/cfg/2006/04/CfgDB-20060425T183631.root
The script KanUpdateRulesCfgDB from the package KanNonEventUtils is used to update the link and created the proper configuration file. The argument to the script is the CfgDB name:
KanUpdateRulesCfgDB /store/cfg/2006/04/CfgDB-20060425T183631.root
Note that the directory where the rules file lives should be writable by the person who will be running the update script. This script should only be ran once the snapshot is available for the clients.
The CDB employs the same structure for the config files and name rules as used for the CfgDB. The name rules file is:
$BFROOT/kanga/config/cdb/CdbNameRules.cfgUnlike the for the CfgDB this file might contain more then one include directive because different types of conditions snapshots exist (e.g.: cond18boot-betamini, cond18boot-full, ..). The content might be:
# we don't allow writing to a generic DB write /cdb/cdb_boot\.root error # generic name translation for "cond18boot betamini" snapshot -include kanga/config/cdb/CdbNameRules-cond18boot-betamini.cfg # generic name translation for "cond18boot full" snapshot -include kanga/config/cdb/CdbNameRules-cond18boot-full.cfgAgain the include files are usually links to files that are specific for a snapshot. The script KanUpdateRulesCDB in package KanNonEventUtils is used to create these files:
> KanUpdateRulesCDB /store/cdb/cond18boot/betamini/2006/04/20060419T091147/CDB-20060419T091147-cdb_boot.rootwould create the file CdbNameRules-cond18boot-betamini-20060419T091147.cfg and CdbNameRules-cond18boot-betamini.cfg would point to it.