Public Member Functions | Public Attributes | Private Attributes

rm_SysState Class Reference
[Resource Manager]

#include <rm.h>

Collaboration diagram for rm_SysState:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 rm_SysState ()
 ~rm_SysState ()
void UnRegisterPM (const string &a_pmName)
void UpdatePM (rm_PartitionStatus &a_pmStat)
rm_PartitionStatus GetPartStatus (string &a_partName)
bool ReservePart (const string &a_pmName, ivd_JobType_e a_type, Int32_t a_number)
void ReleasePart (const string &a_pmName, ivd_JobType_e a_type, Int32_t a_number)
bool Reserve (const string &a_partName, ivd_JobType_e a_type, Int32_t a_number)
bool Reserve (ivd_JobType_e a_type, Int32_t a_number)
void Release (const string &a_partName, ivd_JobType_e a_type, Int32_t a_number)
void Release (ivd_JobType_e a_type, Int32_t a_number)
bool ReserveSys (ivd_JobType_e a_type, Int32_t a_number)
void ReleaseSys (ivd_JobType_e a_type, Int32_t a_number)
void Init (Int32_t a_maxDrivesRecall, Int32_t a_maxDrivesMig, Int32_t a_maxDrivesReorg, Int32_t a_maxDrivesAdmin, Int32_t a_maxDrivesRecovery, Int32_t a_maxDrivesMaint, Int32_t a_adminPriority, Int32_t a_backupPriority)
Int32_t GetDrivesInUseAll ()
Int32_t GetDrivesInUseRecall ()
Int32_t GetDrivesInUseMig ()
Int32_t GetDrivesInUseReorg ()
Int32_t GetDrivesInUseAdmin ()
Int32_t GetDrivesInUseRecovery ()
Int32_t GetDrivesInUseMaint ()
Int32_t GetMaxDrivesRecall ()
Int32_t GetMaxDrivesMig ()
Int32_t GetMaxDrivesReorg ()
Int32_t GetMaxDrivesAdmin ()
Int32_t GetMaxDrivesRecovery ()
Int32_t GetMaxDrivesMaint ()
Int32_t GetAdminPriority () const
Int32_t GetBackupPriority () const
UInt32_t GetPartitionNr (const string &a_partId) const
void LogCurrentState ()
i_MigID_t GetNewMigID (const string a_partName)
Int32_t GetRecallPriority (string a_partName) const
Int32_t GetMigrationPriority (string a_partName) const
Int32_t GetReorgPriority (string a_partName) const
Int32_t GetRecoveryPriority (string a_partName) const
Int32_t GetMaintPriority (string a_partName) const
Int32_t GetPartitionPriority (string a_partName) const

Public Attributes

cmn_Mutex m_partition_x
cmn_Mutex m_status_x
partVec_t m_partitions

Private Attributes

Int32_t m_drivesInUseAll
Int32_t m_drivesInUseRecall
Int32_t m_drivesInUseMig
Int32_t m_drivesInUseReorg
Int32_t m_drivesInUseAdmin
Int32_t m_drivesInUseRecovery
Int32_t m_drivesInUseMaint
Int32_t m_maxDrivesRecall
Int32_t m_maxDrivesMig
Int32_t m_maxDrivesReorg
Int32_t m_maxDrivesAdmin
Int32_t m_maxDrivesRecovery
Int32_t m_maxDrivesMaint
Int32_t m_adminPriority
Int32_t m_backupPriority
 log_CLASSID_m

Detailed Description

Definition at line 182 of file rm.h.


Constructor & Destructor Documentation

rm_SysState::rm_SysState (  ) 
rm_SysState::~rm_SysState (  )  [inline]

Definition at line 186 of file rm.h.

{ /*empty*/ };


Member Function Documentation

Int32_t rm_SysState::GetAdminPriority (  )  const [inline]

Definition at line 246 of file rm.h.

References m_adminPriority.

Referenced by rm_Queue::CalcPriority(), i_ResourceManager_i::ExchangeResources(), and i_ResourceManager_i::GetResources().

{ return m_adminPriority;       };

Here is the caller graph for this function:

Int32_t rm_SysState::GetBackupPriority (  )  const [inline]

Definition at line 247 of file rm.h.

References m_backupPriority.

Referenced by rm_Queue::CalcPriority(), i_ResourceManager_i::ExchangeResources(), and i_ResourceManager_i::GetResources().

{ return m_backupPriority;       };

Here is the caller graph for this function:

Int32_t rm_SysState::GetDrivesInUseAdmin (  )  [inline]

Definition at line 235 of file rm.h.

References m_drivesInUseAdmin.

{ return m_drivesInUseAdmin;    };

Int32_t rm_SysState::GetDrivesInUseAll (  )  [inline]

Definition at line 231 of file rm.h.

References m_drivesInUseAll.

{ return m_drivesInUseAll;      };

Int32_t rm_SysState::GetDrivesInUseMaint (  )  [inline]

Definition at line 237 of file rm.h.

References m_drivesInUseMaint.

{ return m_drivesInUseMaint;    };

Int32_t rm_SysState::GetDrivesInUseMig (  )  [inline]

Definition at line 233 of file rm.h.

References m_drivesInUseMig.

{ return m_drivesInUseMig;      };

Int32_t rm_SysState::GetDrivesInUseRecall (  )  [inline]

Definition at line 232 of file rm.h.

References m_drivesInUseRecall.

{ return m_drivesInUseRecall;   };

Int32_t rm_SysState::GetDrivesInUseRecovery (  )  [inline]

Definition at line 236 of file rm.h.

References m_drivesInUseRecovery.

{ return m_drivesInUseRecovery;    };

Int32_t rm_SysState::GetDrivesInUseReorg (  )  [inline]

Definition at line 234 of file rm.h.

References m_drivesInUseReorg.

{ return m_drivesInUseReorg;    };

Int32_t rm_SysState::GetMaintPriority ( string  a_partName  )  const

Definition at line 449 of file rm_sysstate.cpp.

References GetPartitionNr(), log_FUNC_m, and m_partitions.

Referenced by rm_Queue::CalcPriority().

                                                             {
    log_FUNC_m(GetMaintPriority);
    return m_partitions[GetPartitionNr(a_partName)].GetMaintPriority();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Int32_t rm_SysState::GetMaxDrivesAdmin (  )  [inline]

Definition at line 242 of file rm.h.

References m_maxDrivesAdmin.

{ return m_maxDrivesAdmin;      };

Int32_t rm_SysState::GetMaxDrivesMaint (  )  [inline]

Definition at line 244 of file rm.h.

References m_maxDrivesMaint.

{ return m_maxDrivesMaint;   };

Int32_t rm_SysState::GetMaxDrivesMig (  )  [inline]

Definition at line 240 of file rm.h.

References m_maxDrivesMig.

{ return m_maxDrivesMig;        };

Int32_t rm_SysState::GetMaxDrivesRecall (  )  [inline]

Definition at line 239 of file rm.h.

References m_maxDrivesRecall.

{ return m_maxDrivesRecall;     };

Int32_t rm_SysState::GetMaxDrivesRecovery (  )  [inline]

Definition at line 243 of file rm.h.

References m_maxDrivesRecovery.

{ return m_maxDrivesRecovery;   };

Int32_t rm_SysState::GetMaxDrivesReorg (  )  [inline]

Definition at line 241 of file rm.h.

References m_maxDrivesReorg.

{ return m_maxDrivesReorg;      };

Int32_t rm_SysState::GetMigrationPriority ( string  a_partName  )  const

Definition at line 434 of file rm_sysstate.cpp.

References GetPartitionNr(), log_FUNC_m, and m_partitions.

Referenced by rm_Queue::CalcPriority().

                                                                 {
    log_FUNC_m(GetMigrationPriority);
    return m_partitions[GetPartitionNr(a_partName)].GetMigrationPriority();
}

Here is the call graph for this function:

Here is the caller graph for this function:

i_MigID_t rm_SysState::GetNewMigID ( const string  a_partName  ) 

Definition at line 415 of file rm_sysstate.cpp.

References rm_DBOperation::Execute(), GetPartitionNr(), i_ResourceManager_i::m_DBThread, rm_PartitionStatus::m_iRMi, rm_PartitionStatus::m_part, m_partition_x, and m_partitions.

Referenced by i_ResourceManager_i::GetNewMigId().

                                                         {

    Int64_t newId;
    cmn_MutexLock l(m_partition_x);
    rm_PartitionStatus &ps = m_partitions[GetPartitionNr(a_partName)];

    dbo_GetNewMigId migId(  ps.m_part,
                            newId,
                            *(ps.m_iRMi->m_DBThread));
    migId.Execute();
    return newId;
}

Here is the call graph for this function:

Here is the caller graph for this function:

UInt32_t rm_SysState::GetPartitionNr ( const string &  a_partId  )  const

Definition at line 376 of file rm_sysstate.cpp.

References dbg_DETAIL, dbg_NORM, ie_PARTSTATNF, ivd_Error, log_DBG_m, log_FUNC_A_m, and m_partitions.

Referenced by GetMaintPriority(), GetMigrationPriority(), GetNewMigID(), GetPartitionPriority(), GetPartStatus(), GetRecallPriority(), GetRecoveryPriority(), GetReorgPriority(), ReleasePart(), ReservePart(), and UpdatePM().

                                                                   {
    log_FUNC_A_m(GetPartitionNr,":" << a_partName);

    for (UInt32_t i = 0; i < m_partitions.size(); i++ ){
        if (a_partName.compare(m_partitions[i].GetPartName()) == 0) {
            log_DBG_m(dbg_DETAIL,"Found Partition in activ partition list");
            return i;
        }
    }
    ostringstream msg;
    msg << "Did not found Partition in activ partition list" << a_partName;
    log_DBG_m(dbg_NORM, msg.str());
    throw ivd_Error(ie_PARTSTATNF, msg.str());
}

Here is the caller graph for this function:

Int32_t rm_SysState::GetPartitionPriority ( string  a_partName  )  const

Definition at line 454 of file rm_sysstate.cpp.

References GetPartitionNr(), log_FUNC_m, and m_partitions.

Referenced by rm_Queue::CalcPriority().

                                                                 {
    log_FUNC_m(GetPartitionPriority);
    return m_partitions[GetPartitionNr(a_partName)].GetPartitionPriority();
}

Here is the call graph for this function:

Here is the caller graph for this function:

rm_PartitionStatus rm_SysState::GetPartStatus ( string &  a_partName  ) 

Definition at line 391 of file rm_sysstate.cpp.

References GetPartitionNr(), log_FUNC_A_m, m_partition_x, and m_partitions.

Referenced by rm_Queue::Allocate().

                                                               {
    log_FUNC_A_m(GetPartStatus,":" << a_partName);
    cmn_MutexLock l(m_partition_x);
    return m_partitions[GetPartitionNr(a_partName)];
}

Here is the call graph for this function:

Here is the caller graph for this function:

Int32_t rm_SysState::GetRecallPriority ( string  a_partName  )  const

Definition at line 429 of file rm_sysstate.cpp.

References GetPartitionNr(), log_FUNC_m, and m_partitions.

Referenced by rm_Queue::CalcPriority().

                                                              {
    log_FUNC_m(GetRecallPriority);
    return m_partitions[GetPartitionNr(a_partName)].GetRecallPriority();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Int32_t rm_SysState::GetRecoveryPriority ( string  a_partName  )  const

Definition at line 444 of file rm_sysstate.cpp.

References GetPartitionNr(), log_FUNC_m, and m_partitions.

Referenced by rm_Queue::CalcPriority().

                                                                {
    log_FUNC_m(GetRecoveryPriority);
    return m_partitions[GetPartitionNr(a_partName)].GetRecoveryPriority();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Int32_t rm_SysState::GetReorgPriority ( string  a_partName  )  const

Definition at line 439 of file rm_sysstate.cpp.

References GetPartitionNr(), log_FUNC_m, and m_partitions.

                                                             {
    log_FUNC_m(GetReorgPriority);
    return m_partitions[GetPartitionNr(a_partName)].GetReorgPriority();
}

Here is the call graph for this function:

void rm_SysState::Init ( Int32_t  a_maxDrivesRecall,
Int32_t  a_maxDrivesMig,
Int32_t  a_maxDrivesReorg,
Int32_t  a_maxDrivesAdmin,
Int32_t  a_maxDrivesRecovery,
Int32_t  a_maxDrivesMaint,
Int32_t  a_adminPriority,
Int32_t  a_backupPriority 
)

Definition at line 65 of file rm_sysstate.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_adminPriority, m_backupPriority, m_maxDrivesAdmin, m_maxDrivesMaint, m_maxDrivesMig, m_maxDrivesRecall, m_maxDrivesRecovery, m_maxDrivesReorg, and m_status_x.

Referenced by i_ResourceManager_i::i_ResourceManager_i().

                                                {
    log_FUNC_m(Init);
    cmn_MutexLock l(m_status_x);
    m_maxDrivesRecall   = a_maxDrivesRecall;
    m_maxDrivesMig      = a_maxDrivesMig;
    m_maxDrivesReorg    = a_maxDrivesAdmin;
    m_maxDrivesAdmin    = a_maxDrivesAdmin;
    m_maxDrivesRecovery = a_maxDrivesRecovery;
    m_maxDrivesMaint    = a_maxDrivesMaint;
    m_adminPriority     = a_adminPriority;
    m_backupPriority    = a_backupPriority;

    log_DBG_m(dbg_DETAIL,"Initializing SysState "   << m_maxDrivesRecall << " "
                                                    << m_maxDrivesMig << " "
                                                    << m_maxDrivesReorg << " "
                                                    << m_maxDrivesAdmin << " "
                                                    << m_maxDrivesRecovery << " "
                                                    << m_maxDrivesMaint );

}

Here is the caller graph for this function:

void rm_SysState::LogCurrentState (  ) 

Definition at line 93 of file rm_sysstate.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_drivesInUseAdmin, m_drivesInUseAll, m_drivesInUseMaint, m_drivesInUseMig, m_drivesInUseRecall, m_drivesInUseRecovery, m_drivesInUseReorg, m_maxDrivesAdmin, m_maxDrivesMaint, m_maxDrivesMig, m_maxDrivesRecall, m_maxDrivesRecovery, and m_maxDrivesReorg.

Referenced by ReleaseSys(), and ReserveSys().

                                 {
    log_FUNC_m(LogCurrentState);
    log_DBG_m(dbg_DETAIL,   "DrivesInUseAll      " <<
                            "DrivesInUseRecall   " <<
                            "DrivesInUseMig      " <<
                            "DrivesInUseReorg    " <<
                            "DrivesInUseAdmin    " <<
                            "DrivesInUseRecovery " <<
                            "DrivesInUseMaint    ");


    log_DBG_m(dbg_DETAIL, m_drivesInUseAll
                          << "                   " << m_drivesInUseRecall
                          << "                   " << m_drivesInUseMig
                          << "                   " << m_drivesInUseReorg
                          << "                   " << m_drivesInUseAdmin
                          << "                   " << m_drivesInUseRecovery
                          << "                   " << m_drivesInUseMaint);

    log_DBG_m(dbg_DETAIL,   "MaxDrivesRecall   "  <<
                            "MaxDrivesMig      "  <<
                            "MaxDrivesReorg    "  <<
                            "MaxDrivesAdmin    "  <<
                            "MaxDrivesRecovery "  <<
                            "MaxDrivesMaint    "  );

    log_DBG_m(dbg_DETAIL,   m_maxDrivesRecall
                            << "                  " << m_maxDrivesMig
                            << "                  " << m_maxDrivesReorg
                            << "                  " << m_maxDrivesAdmin
                            << "                  " << m_maxDrivesRecovery
                            << "                  " << m_maxDrivesMaint);
}

Here is the caller graph for this function:

void rm_SysState::Release ( const string &  a_partName,
ivd_JobType_e  a_type,
Int32_t  a_number 
)

Definition at line 149 of file rm_sysstate.cpp.

References log_FUNC_m, ReleasePart(), and ReleaseSys().

Referenced by rm_Queue::AllocateAdmin(), rm_Queue::AllocateMaint(), rm_Queue::AllocateMig(), rm_Queue::AllocateRecovery(), rm_Queue::AllocateReorg(), Release(), i_ResourceManager_i::ReleaseResource(), and ReleaseSys().

                                           {
    log_FUNC_m(Release);
    ReleaseSys(a_type, a_number);
    ReleasePart(a_partName, a_type, a_number);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_SysState::Release ( ivd_JobType_e  a_type,
Int32_t  a_number 
)

Definition at line 157 of file rm_sysstate.cpp.

References log_FUNC_m, Release(), and ReleaseSys().

                                           {
    log_FUNC_m(Release);
    ReleaseSys(a_type, a_number);
}

Here is the call graph for this function:

void rm_SysState::ReleasePart ( const string &  a_pmName,
ivd_JobType_e  a_type,
Int32_t  a_number 
)

Definition at line 406 of file rm_sysstate.cpp.

References GetPartitionNr(), log_FUNC_A_m, m_partition_x, m_partitions, and ReservePart().

Referenced by Release().

                                                 {
    log_FUNC_A_m(ReservePart,"a_partName:" << a_partName);
    cmn_MutexLock l(m_partition_x);
    m_partitions[GetPartitionNr(a_partName)].Release(a_type, a_number);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_SysState::ReleaseSys ( ivd_JobType_e  a_type,
Int32_t  a_number 
)

Definition at line 234 of file rm_sysstate.cpp.

References cmn_Global::dbg, dbg_DETAIL, g_cmn, log_Debugger::GetLevel(), ie_NOJOBTYPE, ie_RELEASEERR, ivd_Error, jt_ADMIN, jt_BACKUP, jt_MAINT, jt_MIGRATION, jt_RECALL, jt_RECOVERY, jt_REORG, log_DBG_m, log_FUNC_m, LogCurrentState(), m_drivesInUseAdmin, m_drivesInUseAll, m_drivesInUseMaint, m_drivesInUseMig, m_drivesInUseRecall, m_drivesInUseRecovery, m_status_x, and Release().

Referenced by Release(), and Reserve().

                                                                  {
    log_FUNC_m(Release);
    cmn_MutexLock l(m_status_x);
    if (g_cmn.dbg.GetLevel() == dbg_DETAIL) {
        LogCurrentState();
    }
    if ( (m_drivesInUseAll - a_number) < 0) {
        throw ivd_Error(ie_RELEASEERR, " SysState:Can not release more drives than allocated",true);
    };
    switch (a_type) {
    case (jt_RECALL):      log_DBG_m(dbg_DETAIL, "SysState:Releasing recall resources");
                            if ( (m_drivesInUseRecall - a_number) >= 0) {
                                m_drivesInUseAll    -= a_number;
                                m_drivesInUseRecall -= a_number;
                            } else {
                                log_DBG_m(dbg_DETAIL, " SysState:Can not release more drives than allocated");
                                throw ivd_Error(ie_RELEASEERR, " SysState:Can not release more drives than allocated", true);
                            }
                            break;

    case (jt_MIGRATION):   log_DBG_m(dbg_DETAIL, "SysState:Releasing migration resources");
                            if ( (m_drivesInUseMig - a_number) >= 0) {
                                m_drivesInUseAll    -= a_number;
                                m_drivesInUseMig    -= a_number;

                            } else {
                                log_DBG_m(dbg_DETAIL, " SysState:Can not release more drives than allocated");
                                throw ivd_Error(ie_RELEASEERR, " SysState:Can not release more drives than allocated", true);
                            }
                            break;

/*    case (jt_REORG):       log_DBG_m(dbg_DETAIL, "SysState:Releasing reorg resources");
                            if ( (m_drivesInUseReorg - a_number) >= 0) {
                                m_drivesInUseAll    -= a_number;
                                m_drivesInUseReorg  -= a_number;
                            } else {
                                log_DBG_m(dbg_DETAIL, " SysState:Can not release more drives than allocated");
                                throw ivd_Error(ie_RELEASEERR, " SysState:Can not release more drives than allocated", true);
                            }
                            break;*/

    case (jt_ADMIN):
    case (jt_BACKUP):      log_DBG_m(dbg_DETAIL, "SysState:Releasing admin resources");
                            if ( (m_drivesInUseAdmin - a_number) >= 0) {
                                m_drivesInUseAll -= a_number;
                                m_drivesInUseAdmin -= a_number;
                            } else {
                                log_DBG_m(dbg_DETAIL, " SysState:Can not release more drives than allocated");
                                throw ivd_Error(ie_RELEASEERR, " SysState:Can not release more drives than allocated", true);
                            }
                            break;
    case (jt_RECOVERY):       log_DBG_m(dbg_DETAIL, "SysState:Releasing recovery resources");
                            if ( (m_drivesInUseRecovery - a_number) >= 0) {
                                m_drivesInUseAll -= a_number;
                                m_drivesInUseRecovery -= a_number;
                            } else {
                                log_DBG_m(dbg_DETAIL, " SysState:Can not release more drives than allocated");
                                throw ivd_Error(ie_RELEASEERR, " SysState:Can not release more drives than allocated", true);
                            }
                            break;
    case (jt_REORG):
    case (jt_MAINT):       log_DBG_m(dbg_DETAIL, "SysState:Releasing maint resources");
                            if ( (m_drivesInUseMaint - a_number) >= 0) {
                                m_drivesInUseAll -= a_number;
                                m_drivesInUseMaint -= a_number;
                            } else {
                                log_DBG_m(dbg_DETAIL, " SysState:Can not release more drives than allocated");
                                throw ivd_Error(ie_RELEASEERR, " SysState:Can not release more drives than allocated", true);
                            }
                            break;

    default:                throw ivd_InternalError (ie_NOJOBTYPE, "SysState:Can not reserve drives in SysState w/o job type", true);
    };

}

Here is the call graph for this function:

Here is the caller graph for this function:

bool rm_SysState::Reserve ( ivd_JobType_e  a_type,
Int32_t  a_number 
)

Definition at line 143 of file rm_sysstate.cpp.

References log_FUNC_m, Reserve(), and ReserveSys().

                                           {
    log_FUNC_m(Reserve);
    return ReserveSys(a_type, a_number);
}

Here is the call graph for this function:

bool rm_SysState::Reserve ( const string &  a_partName,
ivd_JobType_e  a_type,
Int32_t  a_number 
)

Definition at line 127 of file rm_sysstate.cpp.

References log_FUNC_m, ReleaseSys(), ReservePart(), and ReserveSys().

Referenced by rm_Queue::AllocateAdmin(), rm_Queue::AllocateMaint(), rm_Queue::AllocateMig(), rm_Queue::AllocateRec(), rm_Queue::AllocateRecovery(), rm_Queue::AllocateReorg(), Reserve(), and ReserveSys().

                                           {
    log_FUNC_m(Reserve);
    if (ReserveSys(a_type, a_number)) {
        if (ReservePart(a_partName, a_type, a_number)) {
            return true;
        }
        else {
            ReleaseSys(a_type, a_number);
        }
    }

    return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool rm_SysState::ReservePart ( const string &  a_pmName,
ivd_JobType_e  a_type,
Int32_t  a_number 
)

Definition at line 397 of file rm_sysstate.cpp.

References GetPartitionNr(), log_FUNC_A_m, m_partition_x, and m_partitions.

Referenced by ReleasePart(), and Reserve().

                                                 {

    log_FUNC_A_m(ReservePart,"a_partName:" << a_partName);
    cmn_MutexLock l(m_partition_x);
    return m_partitions[GetPartitionNr(a_partName)].Reserve(a_type, a_number);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool rm_SysState::ReserveSys ( ivd_JobType_e  a_type,
Int32_t  a_number 
)

Definition at line 163 of file rm_sysstate.cpp.

References cmn_Global::dbg, dbg_NORM, g_cmn, log_Debugger::GetLevel(), ie_NOJOBTYPE, jt_ADMIN, jt_BACKUP, jt_MAINT, jt_MIGRATION, jt_RECALL, jt_RECOVERY, jt_REORG, log_DBG_m, log_FUNC_m, LogCurrentState(), m_drivesInUseAdmin, m_drivesInUseAll, m_drivesInUseMaint, m_drivesInUseMig, m_drivesInUseRecall, m_drivesInUseRecovery, m_maxDrivesAdmin, m_maxDrivesMaint, m_maxDrivesMig, m_maxDrivesRecall, m_maxDrivesRecovery, m_status_x, and Reserve().

Referenced by Reserve().

                                                                  {
    log_FUNC_m(Reserve);
    cmn_MutexLock l(m_status_x);
    if (g_cmn.dbg.GetLevel() == dbg_DETAIL) {
        LogCurrentState();
    }
    switch (a_type) {
    case (jt_RECALL):      if (m_drivesInUseRecall + a_number <= m_maxDrivesRecall) {
                                m_drivesInUseAll    += a_number;
                                m_drivesInUseRecall += a_number;
                                return true;
                            } else {
                                log_DBG_m(dbg_NORM,"Not enough drives for recall Cfg:"<<
                                                    m_maxDrivesRecall << " InUse:" << m_drivesInUseRecall);
                                return false;
                            };

    case (jt_MIGRATION):   if (m_drivesInUseMig + a_number <= m_maxDrivesMig) {
                                m_drivesInUseAll    += a_number;
                                m_drivesInUseMig    += a_number;
                                return true;
                            } else {
                                log_DBG_m(dbg_NORM,"Not enough drives for Mig Cfg:" <<
                                                    m_maxDrivesMig << " InUse:" << m_drivesInUseMig );
                                return false;
                            };
    /*case (jt_REORG):       if (m_drivesInUseReorg + a_number <= m_maxDrivesReorg) {
                                m_drivesInUseAll    += a_number;
                                m_drivesInUseReorg  += a_number;
                                return true;
                            } else {
                                log_DBG_m(dbg_NORM,"Not enough drives for Reorg"<<
                                                    m_maxDrivesReorg << " InUse:" << m_drivesInUseReorg);
                                return false;
                            };*/
    case (jt_ADMIN):
    case (jt_BACKUP):
                            if (m_drivesInUseAdmin + a_number <= m_maxDrivesAdmin) {
                                m_drivesInUseAll    += a_number;
                                m_drivesInUseAdmin  += a_number;
                                return true;
                            } else {
                                log_DBG_m(dbg_NORM,"Not enough drives for Admin"<<
                                                    m_maxDrivesAdmin << " InUse:" << m_drivesInUseAdmin);
                                return false;
                            };
    case (jt_RECOVERY):    if (m_drivesInUseRecovery + a_number <= m_maxDrivesRecovery) {
                                m_drivesInUseAll    += a_number;
                                m_drivesInUseRecovery  += a_number;
                                return true;
                            } else {
                                log_DBG_m(dbg_NORM,"Not enough drives for Recovery"<<
                                                    m_maxDrivesRecovery << " InUse:" << m_drivesInUseRecovery);
                                return false;
                            };
    case (jt_REORG):
    case (jt_MAINT):       if (m_drivesInUseMaint + a_number <= m_maxDrivesMaint) {
                                m_drivesInUseAll    += a_number;
                                m_drivesInUseMaint  += a_number;
                                return true;
                            } else {
                                log_DBG_m(dbg_NORM,"Not enough drives for Maint"<<
                                                    m_maxDrivesMaint << " InUse:" << m_drivesInUseMaint);
                                return false;
                            };

    default:                throw ivd_InternalError (ie_NOJOBTYPE, "Can not reserve drives in SysStae w/o job type", true);
    };

}

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_SysState::UnRegisterPM ( const string &  a_pmName  ) 

Definition at line 339 of file rm_sysstate.cpp.

References cmn_Global::dbg, dbg_DETAIL, dbg_NORM, g_cmn, log_Debugger::GetLevel(), ie_PARTSTATNF, ivd_Error, log_DBG_m, log_FUNC_A_m, m_partition_x, and m_partitions.

Referenced by i_ResourceManager_i::UnRegisterPartition().

                                                      {
    log_FUNC_A_m(UnRegisterPM,":" << a_partName);

    cmn_MutexLock l(m_partition_x);
    bool found(false);
    log_DBG_m(dbg_DETAIL,"Printing all partitions");

    partVecIT_t iT;
    for (iT = m_partitions.begin(); iT != m_partitions.end(); iT++) {
        iT->LogCurrentState();
    }

    log_DBG_m(dbg_DETAIL,"Will erase now");

    for (iT = m_partitions.begin(); iT != m_partitions.end(); iT++) {
        if ( a_partName == iT->GetPartName() ) {
            if (g_cmn.dbg.GetLevel() == dbg_DETAIL) {
                iT->LogCurrentState();
            }
            m_partitions.erase(iT);
            log_DBG_m(dbg_NORM,"Deleting partition from list of active");
            found = true;
            break;
        };
    }
    log_DBG_m(dbg_DETAIL,"Printing all partitions after delete");
    for (iT = m_partitions.begin(); iT != m_partitions.end(); iT++) {
        iT->LogCurrentState();
    }

    if (!found) {
        throw ivd_Error(ie_PARTSTATNF, "Can not Un-Register non-existing partition");
    }

}

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_SysState::UpdatePM ( rm_PartitionStatus a_pmStat  ) 

Definition at line 311 of file rm_sysstate.cpp.

References cmn_Global::dbg, dbg_NORM, g_cmn, log_Debugger::GetLevel(), GetPartitionNr(), rm_PartitionStatus::GetPartName(), ie_FATAL_ERROR, log_DBG_m, log_FUNC_m, rm_PartitionStatus::LogCurrentState(), m_partition_x, and m_partitions.

Referenced by i_ResourceManager_i::SetRMPartStatus().

                                                      {
    log_FUNC_m(UpdatePM);
    cmn_MutexLock l(m_partition_x);

    UInt32_t partNum(0);
    try {
        partNum = GetPartitionNr(a_pmStat.GetPartName());
        if (partNum >= m_partitions.size())
            throw ivd_InternalError(ie_FATAL_ERROR);

        if (g_cmn.dbg.GetLevel() == dbg_DETAIL) {
            m_partitions[partNum].LogCurrentState();
        }
        m_partitions[partNum].Update(a_pmStat);
        if (g_cmn.dbg.GetLevel() == dbg_DETAIL) {
            m_partitions[partNum].LogCurrentState();
        }

    } catch (ivd_Error& e){
        log_DBG_m(dbg_NORM, "partition not found:" << e);
        if (g_cmn.dbg.GetLevel() == dbg_DETAIL) {
            a_pmStat.LogCurrentState();
        }
        m_partitions.push_back(a_pmStat);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 282 of file rm.h.

Definition at line 279 of file rm.h.

Referenced by GetAdminPriority(), and Init().

Definition at line 280 of file rm.h.

Referenced by GetBackupPriority(), and Init().

Definition at line 267 of file rm.h.

Referenced by GetDrivesInUseAdmin(), LogCurrentState(), ReleaseSys(), and ReserveSys().

Definition at line 263 of file rm.h.

Referenced by GetDrivesInUseAll(), LogCurrentState(), ReleaseSys(), and ReserveSys().

Definition at line 269 of file rm.h.

Referenced by GetDrivesInUseMaint(), LogCurrentState(), ReleaseSys(), and ReserveSys().

Definition at line 265 of file rm.h.

Referenced by GetDrivesInUseMig(), LogCurrentState(), ReleaseSys(), and ReserveSys().

Definition at line 264 of file rm.h.

Referenced by GetDrivesInUseRecall(), LogCurrentState(), ReleaseSys(), and ReserveSys().

Definition at line 268 of file rm.h.

Referenced by GetDrivesInUseRecovery(), LogCurrentState(), ReleaseSys(), and ReserveSys().

Definition at line 266 of file rm.h.

Referenced by GetDrivesInUseReorg(), and LogCurrentState().

Definition at line 275 of file rm.h.

Referenced by GetMaxDrivesAdmin(), Init(), LogCurrentState(), and ReserveSys().

Definition at line 277 of file rm.h.

Referenced by GetMaxDrivesMaint(), Init(), LogCurrentState(), and ReserveSys().

Definition at line 273 of file rm.h.

Referenced by GetMaxDrivesMig(), Init(), LogCurrentState(), and ReserveSys().

Definition at line 272 of file rm.h.

Referenced by GetMaxDrivesRecall(), Init(), LogCurrentState(), and ReserveSys().

Definition at line 276 of file rm.h.

Referenced by GetMaxDrivesRecovery(), Init(), LogCurrentState(), and ReserveSys().

Definition at line 274 of file rm.h.

Referenced by GetMaxDrivesReorg(), Init(), and LogCurrentState().

Definition at line 186 of file rm.h.

Referenced by GetNewMigID(), GetPartStatus(), ReleasePart(), ReservePart(), UnRegisterPM(), and UpdatePM().

Definition at line 190 of file rm.h.

Referenced by Init(), ReleaseSys(), and ReserveSys().


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