Public Member Functions | Public Attributes | Private Attributes

hsm_Containers Class Reference
[Classes for managing object list]

#include <hsm_containers.h>

Collaboration diagram for hsm_Containers:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 hsm_Containers (string &a_fsUUID, const cmn_Path &a_path, i_PartitionManager_ptr a_iPM)
virtual ~hsm_Containers ()
void Start ()
void Stop ()

Public Attributes

 log_CLASSID_m

Private Attributes

bool m_RecallFromADPRun
bool m_dirtyListRun
bool m_migcListRun
bool m_relcListRun
bool m_dirWaitListRun
fio_DataBase m_hsmDB

Detailed Description

Definition at line 42 of file hsm_containers.h.


Constructor & Destructor Documentation

hsm_Containers::hsm_Containers ( string &  a_fsUUID,
const cmn_Path a_path,
i_PartitionManager_ptr  a_iPM 
)

Definition at line 95 of file hsm_containers.cpp.

References ClientConf_t::CfgAlternateDataPath, ClientConf_t::CfgCriticalWaterMark, ClientConf_t::CfgHighWaterMark, ClientConf_t::CfgLowWaterMark, ClientConf_t::CfgMaxMigSize, ClientConf_t::CfgMaxNumFiles, ClientConf_t::CfgMaxWaitTime, ClientConf_t::CfgMFAge, ClientConf_t::CfgMigRetentionTime, ClientConf_t::CfgMinFileSize, ClientConf_t::CfgMinMigSize, ClientConf_t::CfgMinNumFiles, ClientConf_t::CfgMinWaitTime, ClientConf_t::CfgRecallRetentionTime, ClientConf_t::CfgReleaseInterval, cmn_GetEnvVariable(), g_Active_p, g_clientConf_p, g_hsmDB_p, g_mig, hsm_defDirWaitTime_c, hsm_defNumberOfJobs_c, hsm_DirWaitTime_c(), hsm_maxDirWaitTime_c, hsm_maxNumberOfJobs_c, hsm_NumberOfJobs_c(), ivd_NULLCHK_m, log_FUNC_m, m_dirtyListRun, m_dirWaitListRun, m_hsmDB, m_migcListRun, m_RecallFromADPRun, m_relcListRun, and s_className.

        :
        m_RecallFromADPRun(false),
        m_dirtyListRun(false),
        m_migcListRun(false),
        m_relcListRun(false),
        m_dirWaitListRun(false),
        m_hsmDB(cmn_UUID_t(a_fsUUID), 
                a_path,  
                new hdb_Tables(a_path, false)) // read write mode
{
    log_FUNC_m(hsm_Containers);

    // set global database variable
    g_hsmDB_p = &m_hsmDB;

    g_hsm_FHCache_p     = new hsm_FHcache(100000); // elements
    ivd_NULLCHK_m(g_hsm_FHCache_p, hsm_FHcache::s_className);

    unsigned int numOfJobs = hsm_defNumberOfJobs_c;
    string s = cmn_GetEnvVariable(hsm_NumberOfJobs_c);
    if (!s.empty()) {
        unsigned int n = atoi(s.c_str());
        if (n < hsm_maxNumberOfJobs_c) {
            numOfJobs = n;
        }
    }

    g_hsm_preJobList_p  = new hsm_JobListMgr(numOfJobs, a_iPM); // number of job vectors
    ivd_NULLCHK_m(g_hsm_preJobList_p, hsm_JobListMgr::s_className);


    unsigned int dirWaitTime = hsm_defDirWaitTime_c;
    string sWaitTime = cmn_GetEnvVariable(hsm_DirWaitTime_c);
    if (!sWaitTime.empty()) {
        unsigned int n = atoi(sWaitTime.c_str());
        if (  n < hsm_maxDirWaitTime_c
           && n > 0) {
            dirWaitTime = n;
        }
    }
    
    // hold directories for dirWaitTime. Default is 10 min.
    g_hsm_dirWaitList_p = new hsm_DirWaitList(m_dirWaitListRun, dirWaitTime);
    
    ivd_NULLCHK_m(g_hsm_dirWaitList_p, hsm_DirWaitList::s_className);

    g_hsm_relcList_p    = new hsm_FHrelc(m_relcListRun,
            g_clientConf_p->CfgReleaseInterval,
            g_clientConf_p->CfgLowWaterMark,        
            g_clientConf_p->CfgHighWaterMark,       
            g_clientConf_p->CfgCriticalWaterMark,   
            g_clientConf_p->CfgMigRetentionTime,    
            g_clientConf_p->CfgRecallRetentionTime, 
            g_clientConf_p->CfgMinFileSize);        
    ivd_NULLCHK_m(g_hsm_relcList_p, hsm_FHrelc::s_className);

    g_hsm_migcList_p    = new hsm_FHmigc(m_migcListRun, a_iPM,
            g_clientConf_p->CfgMinWaitTime,   
            g_clientConf_p->CfgMinNumFiles, 
            g_clientConf_p->CfgMinMigSize,    
            g_clientConf_p->CfgMaxWaitTime,   
            g_clientConf_p->CfgMaxNumFiles,
            g_clientConf_p->CfgMaxMigSize,
            g_mig);

    ivd_NULLCHK_m(g_hsm_migcList_p, hsm_FHmigc::s_className);

    g_hsm_dirtyList_p = new hsm_FHdirty(m_dirtyListRun, g_clientConf_p->CfgMFAge); //DEF_MINFILEAGE); // minFileAge seconds
    ivd_NULLCHK_m(g_hsm_dirtyList_p, hsm_FHdirty::s_className);

    g_hsm_activeList_p  = new hsm_ActiveFH(*g_Active_p);

    g_hsm_FHADPRecall_p = new hsm_FHADPRecall(m_RecallFromADPRun, g_clientConf_p->CfgAlternateDataPath);

}

Here is the call graph for this function:

hsm_Containers::~hsm_Containers (  )  [virtual]

Definition at line 177 of file hsm_containers.cpp.

References log_FUNC_m, and Stop().

{
    log_FUNC_m(~hsm_Containers);
    Stop();
    delete g_hsm_activeList_p;
//DEL    delete g_hsm_dirtyList_p;   CORBA already delete objects
//DEL    delete g_hsm_migcList_p;
//DEL    delete g_hsm_relcList_p;
//DEL    delete g_hsm_dirWaitList_p;
    delete g_hsm_preJobList_p;
    delete g_hsm_FHCache_p;
}

Here is the call graph for this function:


Member Function Documentation

void hsm_Containers::Start (  ) 

Definition at line 192 of file hsm_containers.cpp.

References log_FUNC_m, and cmn_Thread::Start().

Referenced by fs_api::EventMounted().

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_Containers::Stop (  ) 

Definition at line 203 of file hsm_containers.cpp.

References dbg_LOW, ivd_NULLCHK_m, ivd_Sleep, log_DBG_m, log_FUNC_m, m_dirtyListRun, m_dirWaitListRun, m_migcListRun, m_RecallFromADPRun, m_relcListRun, s_className, hsm_FHrelc::Shutdown(), hsm_FHmigc::Shutdown(), hsm_TimedList::Shutdown(), and hsm_FHADPRecall::Shutdown().

Referenced by ~hsm_Containers().

                          {
    log_FUNC_m(Stop);

    log_DBG_m(dbg_LOW, "Ask RecallFromADP list to stop");
    g_hsm_FHADPRecall_p->Shutdown();
    while (m_RecallFromADPRun) {
        ivd_Sleep(1);
        log_DBG_m(dbg_LOW, "Wait RecallFromADP list to stop");
    }

    log_DBG_m(dbg_LOW, "Ask Dirty list to stop");
    ivd_NULLCHK_m(g_hsm_dirtyList_p, "pointer to dirty list is not valid.");
    g_hsm_dirtyList_p->Shutdown();
    while (m_dirtyListRun) {
        ivd_Sleep(1);
        log_DBG_m(dbg_LOW, "Wait Dirty list to stop");
    }

    log_DBG_m(dbg_LOW, "Ask MigCand list to stop");
    ivd_NULLCHK_m(g_hsm_migcList_p, "pointer to mig candidate list is not valid.");
    g_hsm_migcList_p->Shutdown();
    while (m_migcListRun) {
        ivd_Sleep(1);
        log_DBG_m(dbg_LOW, "Wait MigCand list to stop");
    }

    log_DBG_m(dbg_LOW, "Ask RelCand list to stop");
    ivd_NULLCHK_m(g_hsm_relcList_p, "pointer to release candidate list is not valid.");
    g_hsm_relcList_p->Shutdown();
    while (m_relcListRun) {
        ivd_Sleep(1);
        log_DBG_m(dbg_LOW, "Wait RelCand list to stop");
    }

    log_DBG_m(dbg_LOW, "Ask DirWait list to stop");
    ivd_NULLCHK_m(g_hsm_dirWaitList_p, hsm_DirWaitList::s_className);
    g_hsm_dirWaitList_p->Shutdown();
    while (m_dirWaitListRun) {
        ivd_Sleep(1);
        log_DBG_m(dbg_LOW, "Wait DirWait list to stop");
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 60 of file hsm_containers.h.

Definition at line 52 of file hsm_containers.h.

Referenced by hsm_Containers(), and Stop().

Definition at line 55 of file hsm_containers.h.

Referenced by hsm_Containers(), and Stop().

Definition at line 57 of file hsm_containers.h.

Referenced by hsm_Containers().

Definition at line 53 of file hsm_containers.h.

Referenced by hsm_Containers(), and Stop().

Definition at line 51 of file hsm_containers.h.

Referenced by hsm_Containers(), and Stop().

Definition at line 54 of file hsm_containers.h.

Referenced by hsm_Containers(), and Stop().


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