We have a bunch of scripts which relies on the space token information, therefore,I define 2 hash based subroutine in the dcache perl Library, everytime you add/remove a space token

from dcache, the only thing you need to do is to update the hash array which is definied in the subroutine. All the related scripts would retrieve the updated value from these 2 perl subroutines.

the perl dcache lib is located on head02 which also have all of our dcache admin scripts.

the path of dcache lib is /usr/lib/perl5/site_perl/5.8.5/

2 main libraries are included in the subdirectories:

dCache/getmeta.pm (includes general dcache functions)
RepHot/billinginfo.pm  RepHot/getfreq.pm  RepHot/gethot.pm  RepHot/getpmeta.pm (includes rephot related functions)
there is a daily backup for them.

the subroutines associated with the update of space token is in dCache/getmeta.pm.
sub get_pg_meta
{
        my $pgs=shift();
        my %pg_meta;
        foreach my $pg(@$pgs)
        {
                if($pg=~/CaldataPools/)
                {
                        $pg_meta{$pg}="/pnfs/aglt2.org/atlascalibdata";
                }
                elsif($pg=~/ResilientPools/)
                {
                        $pg_meta{$pg}="/pnfs/aglt2.org/dq2{data}";
                }
                elsif($pg=~/AendPools/)
                {
                        $pg_meta{$pg}="/pnfs/aglt2.org/atlasuserdisk";
                }
                 elsif($pg=~/AprodPools/)
                {
                        $pg_meta{$pg}="/pnfs/aglt2.org/atlasproddisk";
                }
                 elsif($pg=~/AdataPools/)
                {
                        $pg_meta{$pg}="/pnfs/aglt2.org/atlasdatadisk";
                }
                 elsif($pg=~/AcalPools/)
                {
                        $pg_meta{$pg}="/pnfs/aglt2.org/atlascalibdisk";
                }
                 elsif($pg=~/AgrpPools/)
                {
                        $pg_meta{$pg}="/pnfs/aglt2.org/atlasgroupdisk";
                }
                 elsif($pg=~/AtlasPools/)
                {
                        $pg_meta{$pg}="/pnfs/aglt2.org/atlasmcdisk";
                }
                elsif($pg=~/AscratchPools/)
                {
                        $pg_meta{$pg}="/pnfs/aglt2.org/atlasscratchdisk";
                }
        }
        return \%pg_meta;
}
sub get_pg_sp
{
        my $pgs=shift();
        my %pg_sp;
         foreach my $pg(@$pgs)
        {
                if($pg=~/CaldataPools/)
                {
                        $pg_sp{$pg}="ATLASCALIBDATA";
                }
                elsif($pg=~/ResilientPools/)
                {
                        $pg_sp{$pg}="ATLASSRM";
                }
                elsif($pg=~/AendPools/)
                {
                        $pg_sp{$pg}="ATLASUSERDISK";
                }
                 elsif($pg=~/AprodPools/)
                {
                        $pg_sp{$pg}="ATLASPRODDISK";
                }
                 elsif($pg=~/AdataPools/)
                {
                        $pg_sp{$pg}="ATLASDATADISK";
                }
                 elsif($pg=~/AcalPools/)
                {
                        $pg_sp{$pg}="ATLASCALIBDISK";
                }
                 elsif($pg=~/AgrpPools/)
                {
                        $pg_sp{$pg}="ATLASGROUPDISK";
                }
                 elsif($pg=~/AtlasPools/)
                {
                        $pg_sp{$pg}="ATLASMCDISK";
                }
                elsif($pg=~/AscratchPools/)
                {
                        $pg_sp{$pg}="ATLASSCRATCHDISK";
                }
        }
        return \%pg_sp;

}

in the first subroutine, get_pg_meta(), it maps the poolgroup name to PNFS root path,

in the second subroutine, get_pg_sp(), it maps the poolgroup name to SPACE TOKEN description.

for information about poolgroup and SPACE TOKEN description , please refer to HowToSetupSpaceToken

-- WenjingWu - 08 Apr 2009
Topic revision: r1 - 08 Apr 2009, WenjingWu
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback