i_PartitionManager_i Class Reference
[Partition Manager]

#include <i_pm_impl.h>

Inheritance diagram for i_PartitionManager_i:

Inheritance graph
[legend]
Collaboration diagram for i_PartitionManager_i:

Collaboration graph
[legend]

List of all members.


Detailed Description

CORBA servant for i_PartitionManager.

Definition at line 50 of file i_pm_impl.h.


Public Member Functions

 i_PartitionManager_i (string &a_partName)
void RefreshCfg ()
i_ClientConf_tRegisterHSM (i_HSM_ptr a_iHsm, CORBA::Char a_pathSeparator)
void UnRegisterHSM ()
void RegisterFSID (const char *a_majorMinor)
void UnRegisterFSID (const char *a_majorMinor)
i_HSM_ptr GetHSM ()
i_FSC_ptr GetFSC ()
i_ResourceManager_ptr GetRM ()
i_JobID_t Migrate (const i_JobRequestList_t &a_files, i_MigID_t a_migrationID, i_ColID_t a_majColId, i_ColID_t a_minColId, i_BitFlag_t a_flags)
i_JobID_t AllocateNewJobIDforEffRecall ()
i_JobID_t Recall (const i_Recall_t &a_file)
i_JobID_t EfficientRecall (const i_RecallList_t &a_files, i_JobID_t a_mainJobID)
i_JobID_t FSCRecovery (const i_StringList_t &a_volumes, i_UIMessageServer_ptr a_uims)
i_JobID_t IVDFSRecover (i_UIMessageServer_ptr a_uims)
i_JobID_t CheckFSCvsIVDFS (i_Count_t a_numFilesPerBatch, CORBA::Short a_sysLoadPct, i_UIMessageServer_ptr a_uims)
i_JobID_t CheckFSCvsMedia (const i_StringList_t &a_volumes, CORBA::Boolean a_autoCorrect, CORBA::Boolean a_removeMissingOnMedia, i_UIMessageServer_ptr a_uims)
i_JobID_t LimitedCheckFSCvsMedia (const i_StringList_t &a_barcodes, const i_VolNumList_t &a_volumes, CORBA::Boolean a_autoCorrect, CORBA::Boolean a_removeMissingOnMedia, i_UIMessageServer_ptr a_uims)
i_JobID_t ReorgScan (i_Time_t a_date, CORBA::Long a_numOfGenerations, i_UIMessageServer_ptr a_uims)
i_JobID_t Reorg (const char *a_barcode, const i_VolNumList_t &a_volumes, i_UIMessageServer_ptr a_uims)
i_JobIDList_tReorgByColId (CORBA::LongLong a_majColId, CORBA::LongLong a_minColId)
i_JobID_t CopyContents (const char *a_barcode, const i_VolNumList_t &a_volumes,::CORBA::Boolean a_best_effort, i_UIMessageServer_ptr a_uims)
i_JobID_t TrigDeletion (i_UIMessageServer_ptr a_uims)
i_Job_ptr GetJob (i_JobID_t a_jobId)
i_JobList_tGetAllJobs ()
i_JobParamsSeq_tGetAllJobsParam ()
i_Count_t GetJobCount ()
void AbortJob (i_JobID_t a_jobId)
void AbortAllJobs ()
i_Status_t GetJobStatus (i_JobID_t a_jobId)
virtual void Remove ()
void ReleaseVolEntries (CORBA::ULong a_mediumKey, CORBA::ULong a_volumeNr)
i_Time_t GetExpirationAge (const char *a_path)
fsc_FileExpirationGetExpirationTree ()
void FSCRecovery (const string &a_medVolIDstr, ivd_MedVolNum_t a_medVolNum, ivd_MediaKey_t a_mediaKey, UInt32_t a_blkSize, UInt32_t a_lastDataPosition)
CORBA::Boolean RecoveryMode ()
CORBA::Boolean RecoveryNeeded ()
i_BitFlag_t GetStatus (CORBA::String_out a_mountPoint, i_BitFlag_t &a_activity)
CORBA::Boolean ReplicationNeeded ()
i_PartitionManager_ptr GetReplicationPM ()
CORBA::Boolean RecallOnlyMode ()
void AddMajorCol (const i_MajorCol_t &a_majorCol)
void UpdateMajorCol (const i_MajorCol_t &a_majorCol)
void SetReorgScan ()
void ClearReorgScan (bool a_succeded)
bool GetReorgScan ()
void StartReorgJob ()
void StopReorgJob ()
string GetName ()
char GetClientPathSeparator ()
void RecoveryModeSet ()
void RecoveryModeClear ()
void ClearRecoveryRunning ()
bool RecoveryOfIVDFSSet ()
void RecoveryOfIVDFSClear ()
bool IsRecoveryOfIVDFSRun ()
void GetPartitionRecord ()
void SetCheckAutoCorrectRunning ()
void ClearCheckAutoCorrectRunning ()
bool GetCheckAutoCorrectRunning ()
void SetCheckRunning ()
void ClearCheckRunning ()
bool GetCheckRunning ()
void GetAllMediaWithPools (fsc_MediumStatus_v &ms)

Public Attributes

cfg_PM m_config
bool m_externalClient
rm_Partition m_rmPart
UInt64_t m_maxDiskBuff
job_dbgDiskBuf_e m_dbgDiskBuff
i_ResourceManager_var m_iRM
i_PartitionManager_var m_iPM
i_FSC_var m_iFSC
i_HSM_var m_iHSM
i_FSC_im_iFSCi

Private Member Functions

virtual ~i_PartitionManager_i ()
void BuildExpirationTree ()
void ParseConfig ()
i_ClientConf_tFillClientCfg ()

Private Attributes

cmn_Mutex m_reorgScan_x
bool m_reorgScanRunning
UInt32_t m_reorgJobCounter
 log_CLASSID_m
string m_partName
bool m_iFSCisDown
pm_JobMgr m_jobMgr
cmn_Mutex m_startup_x
cmn_Mutex m_recoveryMode_x
bool m_recoveryNeeded
bool m_recoveryMode
cmn_Mutex m_checkAutoCorrectRunning_x
bool m_checkAutoCorrectRunning
cmn_Mutex m_checkRunning_x
bool m_checkRunning
bool m_recoveryOfIVDFS
cmn_Mutex m_recoveryOfIVDFS_x
fsc_FileExpiration m_expirationTree
char m_clientPathSeparator

Friends

class pm_JobMgr

Constructor & Destructor Documentation

i_PartitionManager_i::~i_PartitionManager_i (  )  [private, virtual]

Definition at line 214 of file i_pm_impl.cpp.

References dbg_NORM, ipc_EXEC_m, ivd_Sleep, log_DBG_m, log_FUNC_m, m_iFSCisDown, m_iRM, m_partName, and ipc_Corba::Shutdown().

00214                                             {
00215     log_FUNC_m(~i_PartitionManager_i);
00216 
00217     try {
00218         ipc_EXEC_m(
00219             m_iRM->UnRegisterPartition(m_partName.c_str());
00220         );
00221     } catch (ivd_Exception& e) {
00222         // ignore if RM is down
00223         log_DBG_m(dbg_NORM,"UnRegisterPartition failed " << e);
00224     } catch (...) {
00225         // ignore if RM is down
00226         log_DBG_m(dbg_NORM,"UnRegisterPartition failed " );
00227     }
00228 
00229     log_DBG_m(dbg_NORM, "Waiting for FSC to go down.");
00230     do {
00231         ivd_Sleep(1);
00232     }
00233     while (!m_iFSCisDown);
00234 
00235     ipc_Corba::Shutdown();
00236 }

Here is the call graph for this function:

i_PartitionManager_i::i_PartitionManager_i ( string &  a_partName  ) 

Definition at line 44 of file i_pm_impl.cpp.

References cfg_PMCfg::clients, cmn_GetEnvVariable(), pm_JobMgr::CreateFSCRecoveryJob(), dbg_DETAIL, dbg_LOW, dbg_NORM, ivd_BaseException::GetError(), GetPartitionRecord(), cfg_PMCfg::globalTreeOptions, ie_IPC_ORB_EXCEPTION, ipc_EXEC_m, iPM, job_DBG_DISKBUFF(), job_DBG_DISKBUFF_ALL(), job_DBG_DISKBUFF_CORRUPT(), job_DISKBUFALL, job_DISKBUFCORRUPT, job_DISKBUFNONE, log_DBG_m, log_ERR_m, log_FUNC_m, log_WriteEvent(), m_config, m_dbgDiskBuff, m_iFSC, m_iFSCi, m_iFSCisDown, m_iPM, m_iRM, m_jobMgr, m_maxDiskBuff, m_partName, m_recoveryNeeded, m_rmPart, m_startup_x, cfg_PMCfg::name, ParseConfig(), rm_Partition::partitionUUIDString, cfg_PMTree::pools, RecoveryModeSet(), ipc_Corba::RegisterPMByDeviceName(), ipc_Corba::RegisterPMByPMID(), ipc_Corba::ResolveRM(), rmdb_PARTITION_RECOVERY_MODE, pm_JobMgr::SetPMi(), and rm_Partition::status.

Referenced by main().

00045     : m_reorgScanRunning(false),
00046       m_reorgJobCounter(0),
00047       m_externalClient(false),
00048       m_maxDiskBuff(0),
00049       m_partName(a_partName),
00050       m_iFSCisDown(true),
00051       m_recoveryNeeded(false),
00052       m_recoveryMode(false),
00053       m_checkAutoCorrectRunning(false),
00054       m_checkRunning(false),
00055       m_recoveryOfIVDFS(false),
00056       m_clientPathSeparator('?')
00057       { // must be set by HSM register
00058 
00059     log_FUNC_m(i_PartitionManager_i);
00060 
00061     cmn_MutexLock l(m_startup_x);
00062 
00063     string dbgDiskBuff = cmn_GetEnvVariable(job_DBG_DISKBUFF.c_str());
00064 
00065     log_DBG_m(dbg_DETAIL,"dbgDiskBuff: " << dbgDiskBuff);
00066 
00067     if (dbgDiskBuff == job_DBG_DISKBUFF_ALL){
00068         m_dbgDiskBuff = job_DISKBUFALL;
00069     }
00070     else if(dbgDiskBuff == job_DBG_DISKBUFF_CORRUPT) {
00071         m_dbgDiskBuff = job_DISKBUFCORRUPT;
00072     }
00073     else {
00074         m_dbgDiskBuff = job_DISKBUFNONE;
00075     }
00076     log_DBG_m(dbg_DETAIL,"DBG_DISKBUFF: " << m_dbgDiskBuff);
00077 
00078 
00079     ipc_EXEC_m(
00080         CORBA::Object_var obj = ipc_Corba::ResolveRM();
00081         m_iRM = i_ResourceManager::_narrow(obj);
00082     );
00083 
00084 
00085     m_iRM->RegisterPartition(a_partName.c_str());
00086     m_maxDiskBuff = m_iRM->GetMaxDiskBufferSize(a_partName.c_str());
00087     log_DBG_m(dbg_LOW, "m_maxDiskBuff" << m_maxDiskBuff);
00088 
00089     ParseConfig();
00090     GetPartitionRecord();
00091 
00092     //
00093     // NOTE:
00094     //
00095     // PM must register itself and therefore check if another PM is
00096     // already running *BEFORE* loading the FSC.
00097     // Otherwise the journal of the FSC can get *corrupted*.
00098     //
00099     ipc_EXEC_m(
00100         log_DBG_m(dbg_LOW, "Registering PM to NamingService.")
00101         i_PartitionManager_var iPM = this->_this();
00102 
00103         ipc_Corba::RegisterPMByPMID(iPM, m_config.name);
00104 
00105         for (unsigned int i = 0; i < m_config.clients.size(); i++) {
00106             ipc_Corba::RegisterPMByDeviceName(
00107                 iPM,
00108                 m_config.clients[i].name,
00109                 m_config.clients[i].fileSystemId);
00110         }
00111         m_iPM = iPM;
00112 
00113 
00114         // --- End of PM registration
00115 
00116     );
00117 
00118     m_jobMgr.SetPMi(this);
00119     log_DBG_m(dbg_DETAIL, "PM:" << this);
00120 
00121     try {
00122         ipc_EXEC_m(
00123             log_DBG_m(dbg_NORM, "will run FSC now ....");
00124             log_DBG_m(dbg_LOW, "Partition UUID set to:" << m_rmPart.partitionUUIDString);
00125             log_DBG_m(dbg_NORM, "m_config.pool.size = " << m_config.globalTreeOptions.pools.size());
00126 
00127             m_iFSCi = new i_FSC_i(m_rmPart.partitionUUIDString, m_partName, m_iFSCisDown, m_config.globalTreeOptions.pools.size());
00128             m_iFSC = m_iFSCi->_this();
00129 
00130             // Decrease reference count on servant object to
00131             // make POA delete the object on deativate_object.
00132             // Default (initial) reference is 1 and is increased
00133             // by each activation (->_this() makes new activation).
00134             m_iFSCi->_remove_ref();
00135 
00136             log_DBG_m(dbg_NORM, "FSC running ....");
00137             UInt32_t numFileID = m_iFSCi->GetNumOfUsedFileID();
00138             bool volUsed;
00139             ipc_EXEC_m(
00140                 volUsed = m_iRM->IsSomeVolumeUsed(a_partName.c_str());
00141             );
00142 
00143             log_DBG_m(dbg_LOW,"volUsed " << volUsed << endl <<
00144                                  "numFileID" << numFileID);
00145 
00146             ostringstream logStr;
00147             logStr << "FSC initialized. Partition UUID: "
00148                 << m_rmPart.partitionUUIDString << ". Last fileID: "
00149                 << numFileID;
00150 
00151             log_WriteEvent(logStr.str());
00152 
00153 
00154             if (volUsed && (numFileID == 0)) {
00155                 m_recoveryNeeded = true;
00156                 ostringstream sstr;
00157 
00158                 sstr << "New FSC created, but some data exists on medium,"<<
00159                         " Run recovery to recreate FSC.";
00160                 log_WriteEvent(sstr.str(), m_partName);
00161             };
00162         );
00163     }
00164     catch (ivd_Error &ie) {
00165         if (ie.GetError() == ie_IPC_ORB_EXCEPTION) {
00166             delete m_iFSCi;
00167         }   // insert Event Log about here
00168         log_DBG_m(dbg_DETAIL, ie );
00169         throw;
00170     }
00171     catch (...) {
00172         ostringstream sstr;
00173         sstr << "Corrupted DB or FSC creation error.";
00174         log_WriteEvent(sstr.str(), m_partName);
00175         throw;
00176     }
00177 
00178     if ( (m_rmPart.status & rmdb_PARTITION_RECOVERY_MODE) == rmdb_PARTITION_RECOVERY_MODE ){
00179         // recovery was started but did not finish
00180         // restarting recovery
00181 
00182         i_MediumSeqByVol_t_var medVolSeq;
00183         ipc_EXEC_m(
00184             medVolSeq = m_iRM->SelectAllUnrecoveredMedVol(m_partName.c_str());
00185         );
00186 
00187         log_DBG_m(dbg_DETAIL,"Select finished. "); // Selected " << medVolSeq->length() << " medium for recovery");
00188 
00189         i_StringList_t volumes;
00190 
00191         for (UInt32_t medIdx = 0; medIdx < medVolSeq->length(); medIdx++ ){
00192             for (UInt32_t volIdx = 0; volIdx < medVolSeq[medIdx].length(); volIdx++ ){
00193                 volumes.length(volumes.length() + 1);
00194                 log_DBG_m(dbg_DETAIL,"Inserting volume " << medVolSeq[medIdx][volIdx].medVolId);
00195                 volumes[volumes.length()-1] = CORBA::string_dup(medVolSeq[medIdx][volIdx].medVolId);
00196             }
00197         }
00198         log_DBG_m(dbg_LOW,"Will invoke recovery");
00199         try {
00200             RecoveryModeSet();
00201             m_jobMgr.CreateFSCRecoveryJob(volumes, i_UIMessageServer::_nil());
00202         } catch (ivd_Exception& e) {
00203             log_ERR_m("Recovery Retry failed" << e);
00204             // ignore this error and continue
00205         }
00206     }
00211 } // i_PartitionManager_i::i_PartitionManager_i()

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

void i_PartitionManager_i::RefreshCfg (  ) 

Definition at line 911 of file i_pm_impl.cpp.

References cfg_PMCfg::clients, dbg_NORM, FillClientCfg(), ie_NYI, ipc_CATCH_IVD_THROW_CORBA_m, iPM, log_DBG_m, log_FUNC_m, m_config, m_iHSM, ParseConfig(), and ipc_Corba::RegisterPMByDeviceName().

00911                                       {
00912     log_FUNC_m(RefreshCfg);
00913     try {
00914         if (m_config.clients.size() > 1) {
00915             throw ivd_InternalError(ie_NYI, "More than one client configured.");
00916         }
00917 
00918         string oldFSID;
00919         log_DBG_m(dbg_NORM, "oldFSID:" <<
00920                             m_config.clients[0].fileSystemId);
00921         oldFSID = m_config.clients[0].fileSystemId;
00922 
00923         m_config.clients.clear();
00924         ParseConfig();
00925 
00926         i_PartitionManager_var iPM = this->_this();
00927 
00928         if ( (oldFSID.compare(m_config.clients[0].fileSystemId) != 0  )) {
00929             log_DBG_m(dbg_NORM, " registering client name:" << m_config.clients[0].name <<
00930                 " fileSystemId:" << m_config.clients[0].fileSystemId);
00931             ipc_Corba::RegisterPMByDeviceName(
00932                 iPM,
00933                 m_config.clients[0].name,
00934                 m_config.clients[0].fileSystemId);
00935         }
00936 
00937         log_DBG_m(dbg_NORM, "Will fill client cfg.");
00938         i_ClientConf_t_var clientCfg = FillClientCfg();
00939 
00940         if (!CORBA::is_nil(m_iHSM) && !m_iHSM->_non_existent()) {
00941             log_DBG_m(dbg_NORM, "Will send cfg to hsm.");
00942             m_iHSM->Reconfigure(clientCfg);
00943         }
00944     } ipc_CATCH_IVD_THROW_CORBA_m;
00945 } // i_PartitionManager_i::RefreshCfg()

Here is the call graph for this function:

i_ClientConf_t * i_PartitionManager_i::RegisterHSM ( i_HSM_ptr  a_iHsm,
CORBA::Char  a_pathSeparator 
)

Definition at line 997 of file i_pm_impl.cpp.

References dbg_DETAIL, dbg_LOW, dbg_NORM, evt_ERROR, evt_WARNING, FillClientCfg(), i_Component_i::GetVersion(), ie_ARGUMENT_MISSING, ie_CONNECTIVITY, ie_IPC_OBJ_ACTIVE, ie_REGISTER_NOT_ALLOWED, ipc_CATCH_IVD_THROW_CORBA_m, ivd_Error, log_DBG_m, log_FUNC_m, log_WriteEvent(), log_WRN_m, m_clientPathSeparator, m_iHSM, m_partName, m_recoveryNeeded, m_startup_x, and RecoveryMode().

00997                                                                                              {
00998     log_FUNC_m(RegisterHSM);
00999 
01000     // wait for PM to finish starting bug 4212
01001     cmn_MutexLock l(m_startup_x);
01002 
01003     try {
01004         /*Re-coding because of bug 5392 "two HSM processes access HSMDB at same time"
01005          * 1. check if HSM argument is passed properly
01006          * 2. check if old HSM still running
01007          * 3. check if new HSM is accessible
01008          * 4. check if new HSM has proper version
01009          * 5. check if PM is in recovery mode
01010          * 6. register HSM
01011          */
01012 
01013 /***** check if HSM argument is not null ********/
01014         if (CORBA::is_nil(a_ihsm)) {
01015             throw ivd_Error(ie_ARGUMENT_MISSING, "i_HSM_ptr a_ihsm is not set.");
01016         }
01017 
01018 /***** check if old HSM still running ********/
01019         bool hsmRunning(false);
01020         //
01021         // Check if previously registered HSM is still
01022         // active. Prevent registration in that case.
01023         // Mount will fail until previously registered HSM
01024         // successfully writes data to HSMDB. HSMDB Data corruption
01025         // may occur otherwise.
01026         //
01027         if (!CORBA::is_nil(m_iHSM)) { // some HSM is stil registered
01028             try {
01029                 if (!m_iHSM->_non_existent()) { // check if is available
01030                     log_WRN_m(
01031                         "Partition: " << m_partName << " : " <<
01032                         "HSM still active on mount attempt. Aborting registration.");
01033                     hsmRunning = true;
01034                 }
01035                 else {
01036                     log_WRN_m(
01037                         "Partition: " << m_partName << " : " <<
01038                         "HSM still active on mount attempt. Check if it is accesible.");
01039                 }
01040             }
01041             catch (...) { //
01042                 log_DBG_m(dbg_NORM,
01043                     "HSM on saved reference is non existent. That's OK.");
01044             };
01045         }
01046 
01047         if (hsmRunning) {
01048             // Prevent next HSM from starting
01049             throw ivd_Error(ie_IPC_OBJ_ACTIVE, "HSM still active.");
01050         }
01051 
01052 /***** check if new HSM is accesible ********/
01053         log_DBG_m(dbg_DETAIL,"Client " << a_ihsm  << " contacted PM."
01054                 << " Its path separator is '" << m_clientPathSeparator << "'.");
01055 
01056         bool hsmAccessible(false);
01057         try {
01058             if (!a_ihsm->_non_existent()) {
01059                 hsmAccessible = true;
01060             }
01061         }
01062         catch(...) {
01063         }
01064 
01065         if (hsmAccessible) {
01066             log_DBG_m(dbg_NORM, "HSM is accesible.");
01067         }
01068         else {
01069             log_DBG_m(dbg_NORM, "HSM is not accesible.");
01070             ostringstream sstr;
01071             sstr
01072                 << "Can't contact HSM that has contacted PM. "
01073                 << "Please verify network connectivity.";
01074             log_WriteEvent(evt_ERROR, sstr.str(), m_partName);
01075 
01076             throw ivd_Error(ie_CONNECTIVITY, sstr.str());
01077         }
01078 
01079 /***** check if new HSM and PM are same version ********/
01080         bool hsmSupportsVer(true);
01081         i_Version_var hsmVer;
01082         try {
01083              hsmVer = a_ihsm->GetVersion();
01084              log_DBG_m(dbg_LOW,
01085                 "HSM OS/version: "
01086                 << hsmVer->osType << ", "
01087                 << hsmVer->major << "."
01088                 << hsmVer->minor << "."
01089                 << hsmVer->smr << "-"
01090                 << hsmVer->build << " "
01091                 << hsmVer->label);
01092         }
01093         catch(CORBA::MARSHAL) {
01094             // Implementation differs from IDL definition which is used
01095             // by the caller (PM): HSM has old interface.
01096             log_DBG_m(dbg_LOW, "Client returned CORBA::MARSHAL");
01097             hsmSupportsVer = false;
01098         }
01099         catch(CORBA::NO_IMPLEMENT) {
01100             // Servant doesn't have this interface implemeneted.
01101             log_DBG_m(dbg_LOW, "Client returned CORBA::NO_IMPLEMENT");
01102             hsmSupportsVer = false;
01103         }
01104         // other exceptions cause the registration to fail.
01105 
01106         i_Version_var pmVer = GetVersion();
01107 
01108         if (   !hsmSupportsVer
01109             || hsmVer->major != pmVer->major
01110             || hsmVer->minor != pmVer->minor) {
01111 
01112             throw ivd_Error(ie_REGISTER_NOT_ALLOWED,
01113                 "Client and server have incompatible versions.");
01114         }
01115 
01116         if (hsmVer->smr != pmVer->smr) {
01117             log_WriteEvent(evt_WARNING,
01118             "Client and server have different service maintenance release version.",
01119             m_partName);
01120         }
01121 
01122 /***** Check if PM is in recovery mode ********/
01123         // TODO: client path separator can be determined from i_Version (osType)
01124         m_clientPathSeparator = a_pathSeparator;
01125         if (RecoveryMode() ) {
01126             throw ivd_Error(
01127             ie_REGISTER_NOT_ALLOWED,
01128             "HSM wants to register. Can not serve HSM when in Recovery Mode");
01129         };
01130 
01131         if (m_recoveryNeeded) {
01132             throw ivd_Error(
01133                 ie_REGISTER_NOT_ALLOWED,
01134                 "HSM wants to register. Recovery is needed");
01135         };
01136 
01137 /***** Now it is time to register HSM ********/
01138         m_iHSM = i_HSM::_duplicate(a_ihsm);
01139 
01140         log_DBG_m(dbg_DETAIL,"i_HSM_var m_iHSM: " << m_iHSM);
01141 
01142         i_ClientConf_t_var clientCfg = FillClientCfg();
01143         return clientCfg._retn();
01144     } ipc_CATCH_IVD_THROW_CORBA_m;
01145 } // i_PartitionManager_i::RegisterHSM()

Here is the call graph for this function:

void i_PartitionManager_i::UnRegisterHSM (  ) 

Definition at line 1147 of file i_pm_impl.cpp.

References log_FUNC_m, and m_iHSM.

01147                                          {
01148     log_FUNC_m(UnRegisterHSM);
01149     m_iHSM = i_HSM::_nil();
01150 }

void i_PartitionManager_i::RegisterFSID ( const char *  a_majorMinor  ) 

Definition at line 1152 of file i_pm_impl.cpp.

References cfg_PMCfg::clients, dbg_LOW, ipc_EXEC_m, log_DBG_m, log_FUNC_m, m_config, m_iPM, and ipc_Corba::RegisterPMByFSID().

01152                                                                 {
01153     log_FUNC_m(RegisterFSID);
01154 
01155     ipc_EXEC_m(
01156         log_DBG_m(dbg_LOW, "Registering PM to NamingService using FSID.");
01157 
01158         ipc_Corba::RegisterPMByFSID(
01159             m_iPM,
01160             m_config.clients[0].name, // Note: only one client is supported
01161             a_majorMinor);
01162     )
01163 }

Here is the call graph for this function:

void i_PartitionManager_i::UnRegisterFSID ( const char *  a_majorMinor  ) 

Definition at line 1165 of file i_pm_impl.cpp.

References cfg_PMCfg::clients, dbg_LOW, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, log_DBG_m, log_FUNC_m, m_config, and ipc_Corba::RegisterPMByFSID().

01165                                                                   {
01166     log_FUNC_m(UnRegisterFSID);
01167     try {
01168         ipc_EXEC_m(
01169             log_DBG_m(dbg_LOW, "Unregistering PM from NamingService using FSID.");
01170 
01171             ipc_Corba::RegisterPMByFSID(
01172                 i_PartitionManager::_nil(),
01173                 m_config.clients[0].name, // Note: only one client is supported
01174                 a_majorMinor);
01175         );
01176     } ipc_CATCH_IVD_THROW_CORBA_m
01177 }

Here is the call graph for this function:

i_HSM_ptr i_PartitionManager_i::GetHSM (  ) 

Definition at line 964 of file i_pm_impl.cpp.

References cfg_PMCfg::clients, dbg_NORM, ie_LOST_HSM, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ivd_Error, log_DBG_m, log_FUNC_m, log_WRN_m, m_config, m_iHSM, and m_partName.

Referenced by i_FSCCheckJob_i::AbortJob(), i_EfficientRecallJob_i::AbortRecallOnHsm(), i_RecallJob_i::CompleteJob(), i_MigrationJob_i::CompleteJob(), pm_JobMgr::CreateEfficientRecallJobs(), i_MigrationJob_i::Execute(), i_FSCCheckJob_i::Execute(), i_EfficientRecallJob_i::MediumOperationComplete(), and pm_RecallClientThread::Run().

00964                                        {
00965     log_FUNC_m(GetHSM);
00966     try {
00967         if (CORBA::is_nil(m_iHSM)){
00968             log_DBG_m(dbg_NORM, "HSM is_nil");
00969             return i_HSM::_nil();
00970         } else {
00971             log_DBG_m(dbg_NORM, "HSM is_NOT_nil");
00972             bool hsmIsExistant(false);
00973             try {
00974                 ipc_EXEC_m(
00975                     if (!m_iHSM->_non_existent()){
00976                         log_DBG_m(dbg_NORM, "!m_iHSM->_non_existent()");
00977                         hsmIsExistant = true;
00978                     }
00979                 )
00980             } catch (ivd_Error &e){
00981                 log_WRN_m(e);
00982             }
00983             if (hsmIsExistant){
00984                 i_HSM_ptr tmpHSM = i_HSM::_duplicate(m_iHSM);
00985                 return tmpHSM;
00986             } else {
00987                 ostringstream msg;
00988                 msg << "Partition " << m_partName << " lost access to HSM on "
00989                     << m_config.clients[0].name;
00990                 throw ivd_Error(ie_LOST_HSM, msg.str());
00991             }
00992         }
00993     } ipc_CATCH_IVD_THROW_CORBA_m;
00994 } // i_PartitionManager_i::GetHSM()

Here is the caller graph for this function:

i_FSC_ptr i_PartitionManager_i::GetFSC (  ) 

Definition at line 948 of file i_pm_impl.cpp.

References ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and m_iFSC.

Referenced by pm_JobMgr::EfficientRecallGetLocations(), i_RecallJob_i::Execute(), i_ReorgJob_i::GetFSC(), i_RedundantCopyJob_i::GetFSC(), i_RecallJob_i::GetFSC(), i_MigrationJob_i::GetFSC(), and i_EfficientRecallJob_i::GetFSC().

00948                                        {
00949     log_FUNC_m(GetFSC);
00950     try {
00951         i_FSC_ptr tmpFSC = i_FSC::_duplicate(m_iFSC);
00952         return tmpFSC;
00953     } ipc_CATCH_IVD_THROW_CORBA_m;
00954 }

Here is the caller graph for this function:

i_ResourceManager_ptr i_PartitionManager_i::GetRM (  ) 

Definition at line 956 of file i_pm_impl.cpp.

References ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and m_iRM.

00956                                                   {
00957     log_FUNC_m(GetRM);
00958     try {
00959         i_ResourceManager_ptr tmpRM = i_ResourceManager::_duplicate(m_iRM);
00960         return tmpRM;
00961     } ipc_CATCH_IVD_THROW_CORBA_m;
00962 }

i_JobID_t i_PartitionManager_i::Migrate ( const i_JobRequestList_t a_files,
i_MigID_t  a_migrationID,
i_ColID_t  a_majColId,
i_ColID_t  a_minColId,
i_BitFlag_t  a_flags 
)

Definition at line 239 of file i_pm_impl.cpp.

References dbg_LOW, ie_INVALID_ARG, ipc_CATCH_IVD_THROW_CORBA_m, log_DBG_m, log_FUNC_m, m_iHSM, m_jobMgr, and pm_JobMgr::Migrate().

Referenced by i_MigrationJob_i::CompleteJob().

00244                                              {
00245 
00246     log_FUNC_m(Migrate);
00247 
00248     i_JobID_t jobID(0);
00249 
00250     try {
00251         if (CORBA::is_nil(m_iHSM)) {
00252             log_DBG_m(dbg_LOW, "m_iHSM is nil");
00253             throw ivd_InternalError(
00254                 ie_INVALID_ARG,
00255                 "PM does not have reference to HSM. Who requested migration?");
00256         };
00257         pm_FileList files(a_files);
00258 
00259         // Split files to smaller lists, based on policies
00260         jobID = m_jobMgr.Migrate(files, a_migrationID, a_majColId, a_minColId, a_flags);
00261 
00262     } ipc_CATCH_IVD_THROW_CORBA_m;
00263 
00264     return jobID;
00265 }

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t i_PartitionManager_i::AllocateNewJobIDforEffRecall (  ) 

Definition at line 326 of file i_pm_impl.cpp.

References log_FUNC_m, and m_iRM.

00326                                                              {
00327     log_FUNC_m(AllocateNewJobIDforEffRecall);
00328 
00329     return m_iRM->GetNewJobID();
00330 }

i_JobID_t i_PartitionManager_i::Recall ( const i_Recall_t a_file  ) 

Definition at line 307 of file i_pm_impl.cpp.

References pm_JobMgr::CreateRecallJob(), dbg_DETAIL, i_Recall_t::fileID, i_Recall_t::fileIdx, ipc_CATCH_IVD_THROW_CORBA_m, log_DBG_m, log_FUNC_m, and m_jobMgr.

00307                                                                {
00308     log_FUNC_m(Recall);
00309 
00310     i_JobID_t jobID (0);
00311 
00312     log_DBG_m(dbg_DETAIL,"" << endl <<
00313         "**** Recall was called with i_Recall_t param:" << endl <<
00314         " fileID:" << a_file.fileID << endl <<
00315         " fileIdx:" << a_file.fileIdx << endl
00316     );
00317 
00318     try {
00319         jobID = m_jobMgr.CreateRecallJob(a_file);
00320     } ipc_CATCH_IVD_THROW_CORBA_m;
00321 
00322     return jobID;
00323 }

Here is the call graph for this function:

i_JobID_t i_PartitionManager_i::EfficientRecall ( const i_RecallList_t a_files,
i_JobID_t  a_mainJobID 
)

Definition at line 333 of file i_pm_impl.cpp.

References pm_JobMgr::CreateEfficientRecallJobs(), dbg_DETAIL, ipc_CATCH_IVD_THROW_CORBA_m, log_DBG_m, log_FUNC_m, and m_jobMgr.

Referenced by i_EfficientRecallJob_i::RecallRetry().

00333                                                                                                     {
00334     log_FUNC_m(EfficientRecall);
00335 
00336     log_DBG_m(dbg_DETAIL,"" << endl <<
00337         "**** EfficientRecall was called for "
00338         << a_files.length() << " of files."
00339     );
00340 
00341     try {
00342         a_mainJobID = m_jobMgr.CreateEfficientRecallJobs(a_files, a_mainJobID);
00343     } ipc_CATCH_IVD_THROW_CORBA_m;
00344 
00345     return a_mainJobID;
00346 }

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t i_PartitionManager_i::FSCRecovery ( const i_StringList_t a_volumes,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 268 of file i_pm_impl.cpp.

References pm_JobMgr::CreateFSCRecoveryJob(), GetCheckAutoCorrectRunning(), GetCheckRunning(), GetReorgScan(), ie_PRECONDITION, ipc_CATCH_IVD_THROW_CORBA_m, ivd_Error, log_FUNC_m, m_jobMgr, RecoveryMode(), and RecoveryModeSet().

Referenced by i_RecoveryJob_i::ProcessFRI().

00269                                                                      {
00270     log_FUNC_m(Recover);
00271 
00272     try {
00273         if (GetCheckRunning() ||
00274             GetCheckAutoCorrectRunning() ){
00275                 ostringstream msg;
00276                 msg << "Recovery can not be started. " <<
00277                     "Check FSC vs. Media is running.";
00278                 throw ivd_Error(ie_PRECONDITION, msg.str());
00279             }
00280         else if (RecoveryMode()){
00281             ostringstream msg;
00282             msg << "Recovery can not be started. Recovery of FSC is already running. ";
00283             throw ivd_Error(ie_PRECONDITION, msg.str());
00284         }
00285         else if (GetReorgScan()){
00286             ostringstream msg;
00287             msg << "Recovery can not be started. Reorganization scan is running.";
00288             throw ivd_Error(ie_PRECONDITION, msg.str());
00289         };
00290 
00291         RecoveryModeSet();
00292         return m_jobMgr.CreateFSCRecoveryJob(a_volumes, a_uims);
00293 
00294     } ipc_CATCH_IVD_THROW_CORBA_m;
00295 } // i_PartitionManager_i::FSCRecovery()

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t i_PartitionManager_i::IVDFSRecover ( i_UIMessageServer_ptr  a_uims  ) 

Definition at line 298 of file i_pm_impl.cpp.

References pm_JobMgr::CreateIVDFSRecoveryJob(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and m_jobMgr.

00298                                                                          {
00299     log_FUNC_m(IVDFSRecover);
00300 
00301     try {
00302         return m_jobMgr.CreateIVDFSRecoveryJob(a_uims);
00303     } ipc_CATCH_IVD_THROW_CORBA_m;
00304 }

Here is the call graph for this function:

i_JobID_t i_PartitionManager_i::CheckFSCvsIVDFS ( i_Count_t  a_numFilesPerBatch,
CORBA::Short  a_sysLoadPct,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 423 of file i_pm_impl.cpp.

References pm_JobMgr::CheckFSCvsIVDFS(), GetAllMediaWithPools(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, m_iFSCi, m_jobMgr, and i_FSC_i::SetMediumStatusMember().

00426                                       {
00427 
00428     log_FUNC_m(CheckFSCvsIVDFS);
00429 
00430     try {
00431         fsc_MediumStatus_v ms;
00432         GetAllMediaWithPools(ms);
00433 
00434         m_iFSCi->SetMediumStatusMember(ms);
00435         return m_jobMgr.CheckFSCvsIVDFS(a_numFilesPerBatch, a_sysLoadPct, a_uims);
00436     } ipc_CATCH_IVD_THROW_CORBA_m;
00437 }

Here is the call graph for this function:

i_JobID_t i_PartitionManager_i::CheckFSCvsMedia ( const i_StringList_t a_volumes,
CORBA::Boolean  a_autoCorrect,
CORBA::Boolean  a_removeMissingOnMedia,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 440 of file i_pm_impl.cpp.

References pm_JobMgr::CreateCheckFSCvsMediaJob(), dbg_LOW, GetCheckAutoCorrectRunning(), GetCheckRunning(), ie_PRECONDITION, ie_VOL_NOT_FOUND, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ivd_Error, log_DBG_m, log_FUNC_m, m_iRM, m_jobMgr, m_partName, m_reorgScan_x, m_reorgScanRunning, and RecoveryMode().

Referenced by LimitedCheckFSCvsMedia().

00443                                                                          {
00444     log_FUNC_m(CheckFSCvsMedia);
00445 
00446     try {
00447 
00448         // is check or recovery running
00449         if (GetCheckRunning() ||
00450             GetCheckAutoCorrectRunning() ){
00451             ostringstream msg;
00452             msg << "Check FSC vs. Media is already running.";
00453             throw ivd_Error(ie_PRECONDITION, msg.str());
00454         }
00455         else if (RecoveryMode()){
00456             ostringstream msg;
00457             msg << "Recovery of FSC is running. " <<
00458                 "Wait for recovery to finish, then run check";
00459             throw ivd_Error(ie_PRECONDITION, msg.str());
00460         };
00461 
00462 
00463         //
00464         if (a_autoCorrect){
00465             // do not allow reorg scan
00466             cmn_MutexLock l(m_reorgScan_x);
00467             if (m_reorgScanRunning){
00468                 ostringstream msg;
00469                 msg << "Check FSC vs. Media with autocorrect is not allowed" <<
00470                        " when reorganization scan is running.";
00471                 throw ivd_Error(ie_PRECONDITION, msg.str());
00472             }
00473             // clear all scanned statuses for volumes
00474             ipc_EXEC_m(
00475                 m_iRM->ClearReorgScan(m_partName.c_str());
00476             );
00477 
00478         }
00479 
00480         i_MediumSeqByVol_t_var allMedVol;
00481         ipc_EXEC_m(
00482             allMedVol = m_iRM->SelectAllMediumVolByPart(
00483                                         CORBA::string_dup(m_partName.c_str()));
00484         )
00485         log_DBG_m(dbg_LOW,"Selected Medium for Partition: " << allMedVol->length() );
00486 
00487 
00488         i_MediumSeqByVol_t volSeqByMed;
00489 
00490         if (a_volumes.length() > 0) {
00491             i_MediumVolSeq_t tmpVolSeq;
00492 
00493             // recover just specified volumes
00494 
00495             bool found = false;
00496             tmpVolSeq.length( a_volumes.length() );
00497 
00498             // copy all required volumes to tmpVolSeq
00499             for (UInt32_t i = 0; i < a_volumes.length(); i++){
00500 
00501                 for (UInt32_t j = 0; j < allMedVol->length(); j++){
00502                     for (UInt32_t k = 0; k < allMedVol[j].length(); k++){
00503                         if ( strcmp(    allMedVol[j][k].medVolId,
00504                                         a_volumes[i]
00505                                    ) == 0 ) {
00506                             tmpVolSeq[i] = allMedVol[j][k];
00507                             found = true;
00508                             break;
00509                         }
00510                     }
00511                 }
00512                 if (!found){
00513                     throw ivd_Error(    ie_VOL_NOT_FOUND,
00514                                         "Nonexistent Volume was specified.");
00515                 }
00516                 found = false;
00517             }
00518 
00519             // make new volSeqByMed out of tmpVolSeq
00520 
00521             for (UInt32_t i = 0; i < tmpVolSeq.length(); i++){
00522 
00523 
00524                 for (UInt32_t j = 0; j < volSeqByMed.length(); j++){ // for each medium
00525 
00526                     if (volSeqByMed[j].length() > 0){ // is there a medium entry
00527                         if ( strcmp(    volSeqByMed[j][0].mediumBarcode,
00528                                         tmpVolSeq[i].mediumBarcode ) == 0 )
00529                         { // does the barcode match
00530                             volSeqByMed[j].length( volSeqByMed[j].length() + 1);
00531                             volSeqByMed[j][volSeqByMed[j].length() - 1] = tmpVolSeq[i];
00532                             found = true;
00533                             break;
00534                         }
00535                     }
00536                 }
00537                 if (!found){
00538                     // insert new medium
00539                     volSeqByMed.length(volSeqByMed.length() + 1);
00540                     // set length to 1
00541                     volSeqByMed[volSeqByMed.length() - 1].length(1);
00542                     // set first in sequence to vol
00543                     volSeqByMed[volSeqByMed.length() - 1][0] = tmpVolSeq[i];
00544                 }
00545                 found = false;
00546             }
00547 
00548             return m_jobMgr.CreateCheckFSCvsMediaJob(  volSeqByMed,
00549                                                 a_autoCorrect,
00550                                                 a_removeMissingOnMedia,
00551                                                 a_uims);
00552         } else {
00553             // check all volumes
00554             return m_jobMgr.CreateCheckFSCvsMediaJob( *(allMedVol._retn()),
00555                                                 a_autoCorrect,
00556                                                 a_removeMissingOnMedia,
00557                                                 a_uims);
00558         }
00559 
00560     } ipc_CATCH_IVD_THROW_CORBA_m;
00561 }

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t i_PartitionManager_i::LimitedCheckFSCvsMedia ( const i_StringList_t a_barcodes,
const i_VolNumList_t a_volumes,
CORBA::Boolean  a_autoCorrect,
CORBA::Boolean  a_removeMissingOnMedia,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 564 of file i_pm_impl.cpp.

References CheckFSCvsMedia(), pm_JobMgr::CreateCheckFSCvsMediaJob(), dbg_DETAIL, dbg_LOW, GetCheckAutoCorrectRunning(), GetCheckRunning(), ie_INVALID_ARG, ie_PRECONDITION, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ivd_Error, log_DBG_m, log_FUNC_m, m_iRM, m_jobMgr, m_partName, m_reorgScan_x, m_reorgScanRunning, and RecoveryMode().

00569                                           {
00570     log_FUNC_m(CheckFSCvsMedia);
00571 
00572     try {
00573 
00574         // is Check or recovery running
00575         if (GetCheckRunning() ||
00576             GetCheckAutoCorrectRunning() ){
00577             ostringstream msg;
00578             msg << "Check FSC vs. Media is already running.";
00579             throw ivd_Error(ie_PRECONDITION, msg.str());
00580         }
00581         else if (RecoveryMode()){
00582             ostringstream msg;
00583             msg << "Recovery of FSC is running. " <<
00584                 "Wait for recovery to finish, then run check";
00585             throw ivd_Error(ie_PRECONDITION, msg.str());
00586         };
00587 
00588 
00589         //
00590         if (a_autoCorrect){
00591             // do not allow reorg scan
00592             cmn_MutexLock l(m_reorgScan_x);
00593             if (m_reorgScanRunning){
00594                 ostringstream msg;
00595                 msg << "Check FSC vs. Media with autocorrect is not allowed" <<
00596                        " when reorganization scan is running.";
00597                 throw ivd_Error(ie_PRECONDITION, msg.str());
00598             }
00599             // clear all scanned statuses for volumes
00600             ipc_EXEC_m(
00601                 m_iRM->ClearReorgScan(m_partName.c_str());
00602             );
00603         }
00604 
00605         CORBA::ULong numVolumes = a_volumes.length();
00606 
00607         i_MediumSeqByVol_t volSeqByMed;
00608         volSeqByMed.length(a_barcodes.length());
00609         UInt32_t numberOfAllVolumes = 0;
00610         for (UInt32_t i = 0; i < a_barcodes.length(); i++) {
00611             i_MediumVolSeq_t_var mediumVol;
00612 
00613             ipc_EXEC_m(
00614                 mediumVol = m_iRM->SelectAllMediumVolByBarcode(
00615                                             CORBA::string_dup(a_barcodes[i]));
00616             );
00617             log_DBG_m(dbg_DETAIL,"Check medium: " << a_barcodes[i] );
00618             if (numVolumes > 0) {  // check if volume is specified
00619                 i_MediumVolSeq_t &destMediumVol = volSeqByMed[i];
00620                 destMediumVol.length(numVolumes);
00621                 UInt32_t destIdx = 0;
00622                 log_DBG_m(dbg_DETAIL,"Number of specified volumes: " << numVolumes
00623                                 << ", number of medium voumes: " << mediumVol->length());
00624                 for (UInt32_t srcIdx = 0; srcIdx < mediumVol->length(); srcIdx++) {
00625                     Int32_t volNum = mediumVol[srcIdx].medVolNr;
00626                     log_DBG_m(dbg_DETAIL,"Check volume num: " << volNum);
00627                     for (UInt32_t volIdx = 0; volIdx < numVolumes; volIdx++) {
00628                         log_DBG_m(dbg_DETAIL,"by: " << a_volumes[volIdx]);
00629                         if (volNum == a_volumes[volIdx]) { // volume is specified
00630                             destMediumVol[destIdx] = mediumVol[srcIdx];
00631                             destIdx++;
00632                             mediumVol[srcIdx].medVolNr = 0; //
00633                             numberOfAllVolumes++;
00634                             break;
00635                         }
00636                     }
00637                 }
00638                 // cut out non used array elements
00639                 if (destIdx < destMediumVol.length()) {
00640                     destMediumVol.length(destIdx);
00641                 }
00642             }
00643             else {
00644                 numberOfAllVolumes += mediumVol->length();
00645                 volSeqByMed[i] = mediumVol;
00646             }
00647         }
00648 
00649         log_DBG_m(dbg_LOW,"Selected Medium for Partition: " << volSeqByMed.length() );
00650         log_DBG_m(dbg_LOW,"Number of all selected volumes: " << numberOfAllVolumes );
00651         ipc_EXEC_m(
00652             if (numberOfAllVolumes == 0) {
00653                 ostringstream sstr;
00654                 sstr << "None of specified media/volumes are used and reliable.";
00655                 throw ivd_Error(ie_INVALID_ARG, sstr.str());
00656             }
00657             else {
00658                 return m_jobMgr.CreateCheckFSCvsMediaJob(  volSeqByMed,
00659                                                 a_autoCorrect,
00660                                                 a_removeMissingOnMedia,
00661                                                 a_uims);
00662             }
00663         );
00664     } ipc_CATCH_IVD_THROW_CORBA_m;
00665 }

Here is the call graph for this function:

i_JobID_t i_PartitionManager_i::ReorgScan ( i_Time_t  a_date,
CORBA::Long  a_numOfGenerations,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 668 of file i_pm_impl.cpp.

References pm_JobMgr::CreateReorgScanJob(), GetCheckAutoCorrectRunning(), ie_PRECONDITION, ipc_CATCH_IVD_THROW_CORBA_m, ivd_Error, log_FUNC_m, m_jobMgr, and RecoveryMode().

00671                                                                 {
00672     log_FUNC_m(ReorgScan);
00673     try {
00674         if (RecoveryMode()){
00675             throw ivd_Error(ie_PRECONDITION,
00676                 "Recovery of FSC in progress. Reorganization scan is not allowed.");
00677         }
00678         if (GetCheckAutoCorrectRunning()){
00679             throw ivd_Error(ie_PRECONDITION,
00680                 "FSC vs. Media check in progress. Reorganization scan is not allowed.");
00681         }
00682         return m_jobMgr.CreateReorgScanJob( a_date,
00683                                             a_numOfGenerations,
00684                                             a_uims);
00685     } ipc_CATCH_IVD_THROW_CORBA_m
00686 }

Here is the call graph for this function:

i_JobID_t i_PartitionManager_i::Reorg ( const char *  a_barcode,
const i_VolNumList_t a_volumes,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 689 of file i_pm_impl.cpp.

References pm_JobMgr::CreateReorgJob(), GetCheckAutoCorrectRunning(), ie_PRECONDITION, ipc_CATCH_IVD_THROW_CORBA_m, ivd_Error, log_FUNC_m, m_jobMgr, and RecoveryMode().

00691                                                                         {
00692     log_FUNC_m(Reorg);
00693     try {
00694         if (RecoveryMode()){
00695             throw ivd_Error(ie_PRECONDITION,
00696                 "Recovery of FSC in progress. Reorganization is not allowed.");
00697         }
00698         if (GetCheckAutoCorrectRunning()){
00699             throw ivd_Error(ie_PRECONDITION,
00700                 "FSC vs. Media check in progress. Reorganization is not allowed.");
00701         }
00702 
00703         string barcode(a_barcode);
00704         vector<UInt32_t> volumes;
00705         for (UInt32_t i(0); i < a_volumes.length(); i++){
00706             volumes.push_back(a_volumes[i]);
00707         }
00708 
00709         return m_jobMgr.CreateReorgJob(barcode,
00710                                 volumes,
00711                                 a_uims);
00712     } ipc_CATCH_IVD_THROW_CORBA_m
00713 }

Here is the call graph for this function:

i_JobIDList_t * i_PartitionManager_i::ReorgByColId ( CORBA::LongLong  a_majColId,
CORBA::LongLong  a_minColId 
)

Definition at line 715 of file i_pm_impl.cpp.

References cfg_PMCfg::clients, pm_JobMgr::CreateReorgJob(), dbg_DETAIL, dbg_NORM, GetCheckAutoCorrectRunning(), GetReplicationPM(), ie_PRECONDITION, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ivd_Error, log_DBG_m, log_FUNC_m, log_WriteErrorEvent, m_config, m_iRM, m_jobMgr, RecoveryMode(), REPL_JOB_ID_PREFIX, and ReplicationNeeded().

00717                                   {
00718     log_FUNC_m(ReorgByColId);
00719     try {
00720         if (RecoveryMode()){
00721             throw ivd_Error(ie_PRECONDITION,
00722                 "Recovery of FSC in progress. Reorganization is not allowed.");
00723         }
00724         if (GetCheckAutoCorrectRunning()){
00725             throw ivd_Error(ie_PRECONDITION,
00726                 "FSC vs. Media check in progress. Reorganization is not allowed.");
00727         }
00728 
00729         i_PartitionManager_var replPM;
00730         bool doReplication(false);
00731         ipc_EXEC_m(
00732             doReplication = ReplicationNeeded();
00733             if (doReplication) {
00734                 log_DBG_m(dbg_NORM, "Getting PM reference...");
00735                 replPM = GetReplicationPM();
00736                 log_DBG_m(dbg_NORM, "Got PM reference.");
00737             }
00738         );
00739 
00740         vector<i_JobID_t> jobList;
00741         i_ColMediaVolSeq_t_var cmv = m_iRM->SelectAllColVolumes();
00742         UInt32_t i(0);
00743         for (i = 0; i < cmv->length(); i++) {
00744             log_DBG_m(dbg_DETAIL, "medKey: " << cmv[i].mediaKey <<
00745                                     " medVolNr: " << cmv[i].medVolNr);
00746             if (cmv[i].minColId == UInt64_t(a_minColId)) {
00747                 log_DBG_m(dbg_DETAIL, "Starting reorg for MediaKey: " << cmv[i].mediaKey <<
00748                                                         " vol: " << cmv[i].medVolNr);
00749                 i_Medium_t_var med = m_iRM->SelectMediumByKey(cmv[i].mediaKey);
00750                 string barcode(med->barcode);
00751                 vector<UInt32_t> volumes;
00752                 volumes.push_back(cmv[i].medVolNr);
00753                 i_JobID_t jobID = m_jobMgr.CreateReorgJob(barcode, volumes, i_UIMessageServer::_nil());
00754                 jobList.push_back(jobID);
00755             }
00756         }
00757         UInt32_t jobListSize(jobList.size());
00758 
00759         i_JobIDList_t_var replJobs;
00760         if (doReplication) {
00761             log_DBG_m(dbg_NORM, "Invoking reorg on replication server "
00762             << m_config.clients[0].replTargHost << ", partition "
00763             << m_config.clients[0].replTargPart);
00764             if (!CORBA::is_nil(replPM)) {
00765                 try {
00766                     ipc_EXEC_m(
00767                         replJobs = replPM->ReorgByColId(a_majColId, a_minColId);
00768                     );
00769                     log_DBG_m(dbg_NORM, "Replication jobs: " << replJobs->length());
00770                     jobListSize += replJobs->length();
00771                 }
00772                 catch (...) {
00773                     log_DBG_m(dbg_NORM, "Reorg on replication server failed.");
00774                     throw;
00775                 }
00776             }
00777             else {
00778                 log_WriteErrorEvent( "Replication PM is in not available.");
00779                 doReplication = false; // to prevent adding jobs to list
00780             }
00781         }
00782 
00783         i_JobIDList_t_var jobIDs(new i_JobIDList_t());
00784         jobIDs->length(jobListSize);
00785 
00786         log_DBG_m(dbg_NORM, "Started jobs: " << jobList.size());
00787         for (i = 0; i < jobList.size(); i++) {
00788             jobIDs[i] = jobList[i];
00789             log_DBG_m(dbg_NORM, " * " << jobList[i]);
00790         }
00791 
00792         for (i = 0; i < jobList.size(); i++) {
00793             jobIDs[i] = jobList[i];
00794             log_DBG_m(dbg_NORM, "Started jobs:" << jobList[i]);
00795         }
00796 
00797         if (doReplication) {
00798             for (i = 0; i < replJobs->length(); i++) {
00799                 log_DBG_m(dbg_NORM, " * " << (replJobs[i] + REPL_JOB_ID_PREFIX));
00800                 jobIDs[(jobList.size() + i)] = (replJobs[i] + REPL_JOB_ID_PREFIX);
00801             }
00802         }
00803 
00804         return jobIDs._retn();
00805     } ipc_CATCH_IVD_THROW_CORBA_m
00806 }

Here is the call graph for this function:

i_JobID_t i_PartitionManager_i::CopyContents ( const char *  a_barcode,
const i_VolNumList_t a_volumes,
::CORBA::Boolean  a_best_effort,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 818 of file i_pm_impl.cpp.

References pm_JobMgr::CreateCopyContentsJob(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and m_jobMgr.

00821                                                                          {
00822     log_FUNC_m(CopyContents);
00823     try {
00824         string barcode(a_barcode);
00825         return m_jobMgr.CreateCopyContentsJob(barcode, a_volumes, a_best_effort, a_uims);
00826     } ipc_CATCH_IVD_THROW_CORBA_m
00827 
00828 }

Here is the call graph for this function:

i_JobID_t i_PartitionManager_i::TrigDeletion ( i_UIMessageServer_ptr  a_uims  ) 

Definition at line 809 of file i_pm_impl.cpp.

References pm_JobMgr::CreateDelExpiredFilesJob(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and m_jobMgr.

00809                                                                          {
00810     log_FUNC_m(TrigDeletion);
00811 
00812     try {
00813         return m_jobMgr.CreateDelExpiredFilesJob(a_uims);
00814     } ipc_CATCH_IVD_THROW_CORBA_m
00815 }

Here is the call graph for this function:

i_Job_ptr i_PartitionManager_i::GetJob ( i_JobID_t  a_jobId  ) 

Definition at line 831 of file i_pm_impl.cpp.

References job_Manager::FindJob(), i_Job_i::GetJob(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and m_jobMgr.

00831                                                         {
00832     log_FUNC_m(GetJob);
00833 
00834     try {
00835         return m_jobMgr.FindJob(a_jobId)->GetJob();
00836     } ipc_CATCH_IVD_THROW_CORBA_m;
00837 }

Here is the call graph for this function:

i_JobList_t * i_PartitionManager_i::GetAllJobs (  ) 

Definition at line 840 of file i_pm_impl.cpp.

References job_Manager::GetAllJobs(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and m_jobMgr.

Referenced by GetStatus().

00840                                               {
00841     log_FUNC_m(GetAllJobs);
00842 
00843     try {
00844         return m_jobMgr.GetAllJobs();
00845     } ipc_CATCH_IVD_THROW_CORBA_m;
00846 }

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobParamsSeq_t * i_PartitionManager_i::GetAllJobsParam (  ) 

Definition at line 849 of file i_pm_impl.cpp.

References job_Manager::GetAllJobParams(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and m_jobMgr.

00849                                                         {
00850     log_FUNC_m(GetAllJobsParam);
00851 
00852     try{
00853         return m_jobMgr.GetAllJobParams();
00854     } ipc_CATCH_IVD_THROW_CORBA_m;
00855 }

Here is the call graph for this function:

i_Count_t i_PartitionManager_i::GetJobCount (  ) 

Definition at line 880 of file i_pm_impl.cpp.

References job_Manager::GetJobCount(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and m_jobMgr.

00880                                             {
00881     log_FUNC_m(GetJobCount);
00882     try {
00883         return m_jobMgr.GetJobCount();
00884     } ipc_CATCH_IVD_THROW_CORBA_m;
00885 }

Here is the call graph for this function:

void i_PartitionManager_i::AbortJob ( i_JobID_t  a_jobId  ) 

Definition at line 858 of file i_pm_impl.cpp.

References job_Manager::AbortJob(), dbg_DETAIL, ipc_CATCH_IVD_THROW_CORBA_m, log_DBG_m, log_FUNC_m, and m_jobMgr.

00858                                                      {
00859     log_FUNC_m(AbortJob);
00860     try {
00861         UInt64_t jobId = a_jobId;
00862 
00863         log_DBG_m(dbg_DETAIL,"Removing job with id:" << a_jobId);
00864         m_jobMgr.AbortJob(jobId);
00865 
00866 
00867     } ipc_CATCH_IVD_THROW_CORBA_m;
00868 }

Here is the call graph for this function:

void i_PartitionManager_i::AbortAllJobs (  ) 

Definition at line 871 of file i_pm_impl.cpp.

References job_Manager::AbortAllJobs(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and m_jobMgr.

00871                                         {
00872     log_FUNC_m(AbortAllJobs);
00873     try {
00874         m_jobMgr.AbortAllJobs();
00875 
00876     } ipc_CATCH_IVD_THROW_CORBA_m;
00877 }

Here is the call graph for this function:

i_Status_t i_PartitionManager_i::GetJobStatus ( i_JobID_t  a_jobId  ) 

Definition at line 887 of file i_pm_impl.cpp.

References dbg_NORM, job_Manager::GetJobStatus(), GetReplicationPM(), ie_JOB_NOT_FOUND, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, iPM, ivd_Error, log_DBG_m, log_FUNC_m, m_jobMgr, REPL_JOB_ID_PREFIX, and ReplicationNeeded().

00887                                                               {
00888     log_FUNC_m(GetJobStatus);
00889     try {
00890         if (a_jobId > REPL_JOB_ID_PREFIX) {
00891             // Send request to replication target
00892             if (ReplicationNeeded()) {
00893                 ipc_EXEC_m(
00894                     i_PartitionManager_var iPM = GetReplicationPM();
00895                     log_DBG_m(dbg_NORM, "Got PM reference.");
00896 
00897                     return iPM->GetJobStatus(a_jobId - REPL_JOB_ID_PREFIX);
00898                 );
00899             }
00900             else {
00901                 throw ivd_Error(ie_JOB_NOT_FOUND, "Replication not configured.");
00902             }
00903         }
00904         else {
00905                 return m_jobMgr.GetJobStatus(a_jobId);
00906         }
00907     } ipc_CATCH_IVD_THROW_CORBA_m;
00908 }

Here is the call graph for this function:

void i_PartitionManager_i::Remove (  )  [virtual]

Reimplemented from i_Component_i.

Definition at line 1179 of file i_pm_impl.cpp.

References ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, log_FUNC_m, m_iFSCi, and i_Component_i::Remove().

01179                                  {
01180     log_FUNC_m(Remove);
01181     try {
01182         ipc_EXEC_m(
01183             m_iFSCi->Remove();
01184             i_Component_i::Remove();
01185         );
01186     } ipc_CATCH_IVD_THROW_CORBA_m
01187 }

Here is the call graph for this function:

void i_PartitionManager_i::ReleaseVolEntries ( CORBA::ULong  a_mediumKey,
CORBA::ULong  a_volumeNr 
)

Definition at line 1189 of file i_pm_impl.cpp.

References ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_A_m, m_iFSCi, and i_FSC_i::ReleaseVolEntries().

01190                                                                        {
01191 
01192     log_FUNC_A_m(ReleaseVolEntries, "a_mediumKey: " << a_mediumKey <<
01193                                     ", a_volumeNr:" << a_volumeNr);
01194     try {
01195         m_iFSCi->ReleaseVolEntries(a_mediumKey, a_volumeNr);
01196     } ipc_CATCH_IVD_THROW_CORBA_m
01197 }

Here is the call graph for this function:

i_Time_t i_PartitionManager_i::GetExpirationAge ( const char *  a_path  )  [inline]

Definition at line 142 of file i_pm_impl.h.

References fsc_FileExpiration::GetExpirationAge(), and m_expirationTree.

00142                                                   {
00143         return m_expirationTree.GetExpirationAge(a_path);
00144     };

Here is the call graph for this function:

fsc_FileExpiration& i_PartitionManager_i::GetExpirationTree (  )  [inline]

Definition at line 146 of file i_pm_impl.h.

References m_expirationTree.

Referenced by i_DelExpiredFilesJob_i::Execute().

00146 { return m_expirationTree; };

Here is the caller graph for this function:

void i_PartitionManager_i::FSCRecovery ( const string &  a_medVolIDstr,
ivd_MedVolNum_t  a_medVolNum,
ivd_MediaKey_t  a_mediaKey,
UInt32_t  a_blkSize,
UInt32_t  a_lastDataPosition 
) [inline]

Definition at line 149 of file i_pm_impl.h.

References i_FSC_i::FSCRecovery(), and m_iFSCi.

00153                                                                 {
00154         m_iFSCi->FSCRecovery(a_medVolIDstr, a_medVolNum, a_mediaKey, a_blkSize, a_lastDataPosition);
00155     };

Here is the call graph for this function:

CORBA::Boolean i_PartitionManager_i::RecoveryMode (  ) 

Definition at line 1484 of file i_pm_impl.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_recoveryMode, and m_recoveryMode_x.

Referenced by CheckFSCvsMedia(), FSCRecovery(), LimitedCheckFSCvsMedia(), RegisterHSM(), Reorg(), ReorgByColId(), and ReorgScan().

01484                                                 {
01485     log_FUNC_m(RecoveryMode);
01486 
01487     cmn_MutexLock l(m_recoveryMode_x);
01488     log_DBG_m(dbg_DETAIL, "m_recoveryMode:" << m_recoveryMode);
01489 
01490     return m_recoveryMode;
01491 }

Here is the caller graph for this function:

CORBA::Boolean i_PartitionManager_i::RecoveryNeeded (  ) 

Definition at line 1494 of file i_pm_impl.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_recoveryMode_x, and m_recoveryNeeded.

01494                                                   {
01495     log_FUNC_m(RecoveryNeeded);
01496 
01497     cmn_MutexLock l(m_recoveryMode_x);
01498     log_DBG_m(dbg_DETAIL, "m_recoveryNeeded:" << m_recoveryNeeded);
01499 
01500     return m_recoveryNeeded;
01501 }

i_BitFlag_t i_PartitionManager_i::GetStatus ( CORBA::String_out  a_mountPoint,
i_BitFlag_t a_activity 
)

Definition at line 1503 of file i_pm_impl.cpp.

References dbg_NORM, GetAllJobs(), ipc_EXEC_m, log_DBG_m, log_FUNC_m, m_iHSM, m_partName, m_recoveryMode, m_recoveryNeeded, m_rmPart, pa_IDLE, pa_JOBSRUNNING, pa_MOUNTINPROG, pa_RECOVERYINPROG, pa_RECOVERYPENDING, pa_REORGSCANINPROG, pa_UNKNOWN, ps_MOUNTED, ps_READY, ps_RECOVERYMODE, ps_UNKNOWN, rmdb_PARTITION_REORG_SCAN_INPROG, and rm_Partition::status.

01503                                                                                                   {
01504     log_FUNC_m(GetStatus);
01505 
01506     i_BitFlag_t  status = ps_UNKNOWN;
01507     string mountPoint = "<not mounted>";
01508     a_activity = pa_UNKNOWN;
01509 
01510 
01511     // first check if it is mounted
01512 
01513     if (m_recoveryMode) {
01514         status = ps_RECOVERYMODE;
01515         a_activity = pa_RECOVERYINPROG;
01516     }
01517     else if (m_recoveryNeeded) {
01518         status = ps_RECOVERYMODE;
01519         a_activity = pa_RECOVERYPENDING;
01520     }
01521 
01522 
01523     if ( CORBA::is_nil(m_iHSM) ) {
01524         log_DBG_m(dbg_NORM, "PM: HSM for partition "
01525                     << m_partName << " not running.");
01526 
01527         status = ps_READY;
01528 
01529         if (m_rmPart.status & rmdb_PARTITION_REORG_SCAN_INPROG) {
01530             a_activity = pa_REORGSCANINPROG;
01531         }
01532         else {
01533             a_activity = pa_IDLE;
01534         }
01535     }
01536     else {
01537         i_HsmInfo_t_var hsmInfo;
01538         try {
01539             ipc_EXEC_m(m_iHSM->GetInfo(hsmInfo););
01540 
01541             status = ps_MOUNTED;
01542             mountPoint = hsmInfo->mountPoint;
01543 
01544             if (m_rmPart.status & rmdb_PARTITION_REORG_SCAN_INPROG) {
01545                 a_activity = pa_REORGSCANINPROG;
01546             }
01547             else {
01548                 i_JobList_t *jobs = GetAllJobs();
01549                 if (jobs->length() == 0) {
01550                     a_activity = pa_IDLE;
01551                 }
01552                 else {
01553                     a_activity = pa_JOBSRUNNING;
01554                 }
01555             }
01556         }
01557         catch (ivd_Error &e) {
01558             log_DBG_m(dbg_NORM, e);
01559             status = ps_READY;
01560             a_activity = pa_MOUNTINPROG;
01561             mountPoint = "n/a";
01562         }
01563     }
01564 
01565     a_mountPoint = CORBA::string_dup(mountPoint.c_str());
01566     return status;
01567 }

Here is the call graph for this function:

CORBA::Boolean i_PartitionManager_i::ReplicationNeeded (  ) 

Definition at line 1569 of file i_pm_impl.cpp.

References cfg_PMCfg::clients, log_FUNC_m, and m_config.

Referenced by AddMajorCol(), GetJobStatus(), ReorgByColId(), and UpdateMajorCol().

01569                                                      {
01570     log_FUNC_m(ReplicationNeeded);
01571     return (!m_config.clients[0].replTargHost.empty())
01572         && (!m_config.clients[0].replTargPart.empty());
01573 }

Here is the caller graph for this function:

i_PartitionManager_ptr i_PartitionManager_i::GetReplicationPM (  ) 

Definition at line 1575 of file i_pm_impl.cpp.

References cfg_PMCfg::clients, dbg_NORM, ipc_CATCH_IVD_THROW_CORBA_m, iPM, log_DBG_m, log_FUNC_m, m_config, ipc_Corba::ResolveTargetPM(), and ipc_Corba::Singleton().

Referenced by AddMajorCol(), GetJobStatus(), ReorgByColId(), and UpdateMajorCol().

01575                                                               {
01576     log_FUNC_m(GetReplicationPM);
01577     log_DBG_m(dbg_NORM, "Checking connectivity to replication server "
01578         << m_config.clients[0].replTargHost << ", partition "
01579         << m_config.clients[0].replTargPart);
01580 
01581     try {
01582         CORBA::Object_var obj = ipc_Corba::Singleton().ResolveTargetPM(
01583             m_config.clients[0].replTargHost,
01584             m_config.clients[0].replTargPart);
01585 
01586         i_PartitionManager_var iPM = i_PartitionManager::_narrow(obj);
01587         log_DBG_m(dbg_NORM, "Got PM reference.");
01588 
01589         return iPM._retn();
01590     }
01591     ipc_CATCH_IVD_THROW_CORBA_m;
01592 }

Here is the call graph for this function:

Here is the caller graph for this function:

CORBA::Boolean i_PartitionManager_i::RecallOnlyMode (  ) 

Definition at line 1751 of file i_pm_impl.cpp.

References cfg_PMCfg::clients, log_FUNC_m, and m_config.

01751                                                   {
01752     log_FUNC_m(RecallOnlyMode);
01753 
01754     return (m_config.clients[0].disableAutMig != 0);
01755 }

void i_PartitionManager_i::AddMajorCol ( const i_MajorCol_t a_majorCol  ) 

Definition at line 1757 of file i_pm_impl.cpp.

References cfg_PMCfg::clients, dbg_NORM, i_MajorCol_t::flags, GetReplicationPM(), ipc_EXEC_m, log_DBG_m, log_FUNC_A_m, log_WriteErrorEvent, m_config, m_iRM, i_MajorCol_t::majColId, i_MajorCol_t::majColSize, i_MajorCol_t::partUUID, and ReplicationNeeded().

01757                                                                      {
01758     log_FUNC_A_m(AddMajorCol, "majColId: " << a_majorCol.majColId
01759                            << " size: " << a_majorCol.majColSize
01760                            << " partUUID: " << a_majorCol.partUUID
01761                            << " flags: " << a_majorCol.flags);
01762 
01763     i_PartitionManager_var replPM;
01764     bool doReplication(false);
01765     ipc_EXEC_m(
01766         doReplication = ReplicationNeeded();
01767         if (doReplication) {
01768             log_DBG_m(dbg_NORM, "Getting PM reference...");
01769             replPM = GetReplicationPM();
01770             log_DBG_m(dbg_NORM, "Got PM reference.");
01771         }
01772     );
01773 
01774     m_iRM->AddMajorCol(a_majorCol);
01775 
01776     if (doReplication) {
01777         log_DBG_m(dbg_NORM, "Adding major col on replication server "
01778         << m_config.clients[0].replTargHost << ", partition "
01779         << m_config.clients[0].replTargPart);
01780         if (!CORBA::is_nil(replPM)) {
01781             try {
01782                 ipc_EXEC_m(
01783                     i_MajorCol_t tgtMajorCol(a_majorCol);
01784                     i_ResourceManager_var replRM = replPM->GetRM();
01785                     i_Partition_t_var partition = replRM->SelectPartition(m_config.clients[0].replTargPart.c_str());
01786                     tgtMajorCol.partUUID = CORBA::string_dup(partition->partitionUUIDString);
01787                     replPM->AddMajorCol(tgtMajorCol);
01788                 );
01789             }
01790             catch (...) {
01791                 log_DBG_m(dbg_NORM, "Adding major col on replication server failed.");
01792                 throw;
01793             }
01794         }
01795         else {
01796             log_WriteErrorEvent( "Replication PM is in not available.");
01797         }
01798     }
01799 }

Here is the call graph for this function:

void i_PartitionManager_i::UpdateMajorCol ( const i_MajorCol_t a_majorCol  ) 

Definition at line 1801 of file i_pm_impl.cpp.

References cfg_PMCfg::clients, dbg_NORM, i_MajorCol_t::flags, GetReplicationPM(), ipc_EXEC_m, log_DBG_m, log_FUNC_A_m, log_WriteErrorEvent, m_config, m_iRM, i_MajorCol_t::majColId, i_MajorCol_t::majColSize, i_MajorCol_t::partUUID, and ReplicationNeeded().

01801                                                                         {
01802     log_FUNC_A_m(UpdateMajorCol, "majColId: " << a_majorCol.majColId
01803                            << " size: " << a_majorCol.majColSize
01804                            << " partUUID: " << a_majorCol.partUUID
01805                            << " flags: " << a_majorCol.flags);
01806 
01807     i_PartitionManager_var replPM;
01808     bool doReplication(false);
01809     ipc_EXEC_m(
01810         doReplication = ReplicationNeeded();
01811         if (doReplication) {
01812             log_DBG_m(dbg_NORM, "Getting PM reference...");
01813             replPM = GetReplicationPM();
01814             log_DBG_m(dbg_NORM, "Got PM reference.");
01815         }
01816     );
01817 
01818     m_iRM->UpdateMajorCol(a_majorCol);
01819 
01820     if (doReplication) {
01821         log_DBG_m(dbg_NORM, "Updating major col on replication server "
01822         << m_config.clients[0].replTargHost << ", partition "
01823         << m_config.clients[0].replTargPart);
01824         if (!CORBA::is_nil(replPM)) {
01825             try {
01826                 ipc_EXEC_m(
01827                     i_MajorCol_t tgtMajorCol(a_majorCol);
01828                     i_ResourceManager_var replRM = replPM->GetRM();
01829                     i_Partition_t_var partition = replRM->SelectPartition(m_config.clients[0].replTargPart.c_str());
01830                     tgtMajorCol.partUUID = CORBA::string_dup(partition->partitionUUIDString);
01831                     replPM->UpdateMajorCol(tgtMajorCol);
01832                 );
01833             }
01834             catch (...) {
01835                 log_DBG_m(dbg_NORM, "Updating major col on replication server failed.");
01836                 throw;
01837             }
01838         }
01839         else {
01840             log_WriteErrorEvent( "Replication PM is in not available.");
01841         }
01842     }
01843 }

Here is the call graph for this function:

void i_PartitionManager_i::BuildExpirationTree (  )  [private]

Definition at line 1652 of file i_pm_impl.cpp.

References fsc_FileExpiration::Clear(), dbg_DETAIL, dbg_NORM, fsc_FileExpiration::DbgDump(), cfg_PMCfg::deleteFile, g_cmn, cmn_Global::IsDbgActive(), log_DBG_m, log_FUNC_m, m_config, m_expirationTree, and fsc_FileExpiration::SetExpirationAge().

Referenced by ParseConfig().

01652                                                {
01653     log_FUNC_m(BuildExpirationTree);
01654 
01655     m_expirationTree.Clear();
01656 
01657     log_DBG_m(dbg_DETAIL, "m_config.deleteFile.size():" <<
01658                            m_config.deleteFile.size());
01659 
01660     for (UInt32_t item = 0; item < m_config.deleteFile.size(); item++) {
01661         vector<val_Element<string> >::iterator iter
01662                             = m_config.deleteFile[item].m_pathList.begin();
01663         while (iter != m_config.deleteFile[item].m_pathList.end()) {
01664 
01665             log_DBG_m(dbg_DETAIL, "(*iter).Val():" << (*iter).Val()<<
01666                 " m_config.deleteFile[item].m_fileAge:" <<
01667                 m_config.deleteFile[item].m_fileAge);
01668 
01669             m_expirationTree.SetExpirationAge(
01670                         (*iter).Val(), m_config.deleteFile[item].m_fileAge);
01671             iter++;
01672         }
01673     }
01674     if (g_cmn.IsDbgActive()) {
01675         ostringstream sstr;
01676         m_expirationTree.DbgDump(sstr);
01677         log_DBG_m(dbg_NORM, "Expiration tree:" << endl << sstr.str());
01678     }
01679 } // i_PartitionManager_i::BuildExpirationTree()

Here is the call graph for this function:

Here is the caller graph for this function:

void i_PartitionManager_i::SetReorgScan (  ) 

Definition at line 1204 of file i_pm_impl.cpp.

References ie_PRECONDITION, ipc_EXEC_m, ivd_Error, log_FUNC_m, m_iRM, m_partName, m_reorgJobCounter, m_reorgScan_x, m_reorgScanRunning, and rmdb_PARTITION_REORG_SCAN_INPROG.

Referenced by i_ReorgScanJob_i::i_ReorgScanJob_i().

01204                                         {
01205     log_FUNC_m(SetReorgScan);
01206 
01207     cmn_MutexLock l(m_reorgScan_x);
01208     if (m_reorgScanRunning){
01209         throw ivd_Error(ie_PRECONDITION,
01210             "Reorganization scan is already running.");
01211     }
01212     if (m_reorgJobCounter > 0){
01213         throw ivd_Error(ie_PRECONDITION,
01214             "Reorganization job(s) in progress. Reorganization scan not allowed.");
01215     }
01216 
01217     // set status flag in RM
01218     ipc_EXEC_m(
01219         m_iRM->SetPartitionStatus(rmdb_PARTITION_REORG_SCAN_INPROG, m_partName.c_str());
01220     );
01221     m_reorgScanRunning = true;
01222 }

Here is the caller graph for this function:

void i_PartitionManager_i::ClearReorgScan ( bool  a_succeded  ) 

Definition at line 1233 of file i_pm_impl.cpp.

References GetReorgScan(), ie_PRECONDITION, ipc_EXEC_m, log_FUNC_m, m_iRM, m_partName, m_reorgScanRunning, and rmdb_PARTITION_REORG_SCAN_INPROG.

Referenced by i_ReorgScanJob_i::~i_ReorgScanJob_i().

01233                                                          {
01234     log_FUNC_m(ClearReorgScan);
01235 
01236     if (!GetReorgScan()){
01237         throw ivd_InternalError(ie_PRECONDITION,
01238             "Reorganization scan not running.");
01239     }
01240     if (a_succeded){
01241         // Clear status flag in RM
01242         ipc_EXEC_m(
01243             m_iRM->ClearPartitionStatus(rmdb_PARTITION_REORG_SCAN_INPROG, m_partName.c_str());
01244         );
01245     }
01246     m_reorgScanRunning = false;
01247 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool i_PartitionManager_i::GetReorgScan (  ) 

Definition at line 1225 of file i_pm_impl.cpp.

References log_FUNC_m, m_reorgScan_x, and m_reorgScanRunning.

Referenced by ClearReorgScan(), FSCRecovery(), StartReorgJob(), and StopReorgJob().

01225                                         {
01226     log_FUNC_m(GetReorgScan);
01227 
01228     cmn_MutexLock l(m_reorgScan_x);
01229     return m_reorgScanRunning;
01230 }

Here is the caller graph for this function:

void i_PartitionManager_i::StartReorgJob (  ) 

Definition at line 1250 of file i_pm_impl.cpp.

References GetReorgScan(), ie_PRECONDITION, ipc_EXEC_m, ivd_Error, log_FUNC_m, m_iRM, m_partName, m_reorgJobCounter, and rmdb_PARTITION_REORG_SCAN_INPROG.

Referenced by i_ReorgJob_i::i_ReorgJob_i().

01250                                          {
01251     log_FUNC_m(StartReorgJob);
01252 
01253     // Check status flag in RM
01254     i_Partition_t_var part;
01255     ipc_EXEC_m(
01256         part = m_iRM->SelectPartition(m_partName.c_str());
01257     );
01258     if (GetReorgScan()){
01259         throw ivd_Error(ie_PRECONDITION,
01260             "Reorganization scan is running.");
01261     } else if (part->status & rmdb_PARTITION_REORG_SCAN_INPROG){
01262         throw ivd_Error(ie_PRECONDITION,
01263             "Reorganization can't be started because there are no valid reorg scan results.");
01264     }
01265 
01266     m_reorgJobCounter++;
01267 }

Here is the call graph for this function:

Here is the caller graph for this function:

void i_PartitionManager_i::StopReorgJob (  ) 

Definition at line 1270 of file i_pm_impl.cpp.

References GetReorgScan(), ie_FATAL_ERROR, m_reorgJobCounter, and m_reorgScan_x.

Referenced by i_ReorgJob_i::i_ReorgJob_i(), and i_ReorgJob_i::~i_ReorgJob_i().

01270                                         {
01271 
01272     if (GetReorgScan()){
01273         throw ivd_InternalError(ie_FATAL_ERROR,
01274             "Reorganization scan & job running in parallel!");
01275     }
01276 
01277     cmn_MutexLock l(m_reorgScan_x);
01278     if (m_reorgJobCounter == 0){
01279         throw ivd_InternalError(ie_FATAL_ERROR ,
01280                                 "Counter for reorg jobs already 0.");
01281     }
01282 
01283     m_reorgJobCounter--;
01284 }

Here is the call graph for this function:

Here is the caller graph for this function:

string i_PartitionManager_i::GetName ( void   )  [inline]

Definition at line 198 of file i_pm_impl.h.

References m_partName.

Referenced by i_RecreatedIVDFSJob_i::Execute(), i_DelExpiredFilesJob_i::Execute(), i_MediumCheckJob_i::i_MediumCheckJob_i(), and i_RecoveryJob_i::i_RecoveryJob_i().

00198 {return m_partName;};

Here is the caller graph for this function:

char i_PartitionManager_i::GetClientPathSeparator (  )  [inline]

Definition at line 200 of file i_pm_impl.h.

Referenced by i_DelExpiredFilesJob_i::Execute().

00200 { return m_clientPathSeparator; };

Here is the caller graph for this function:

void i_PartitionManager_i::RecoveryModeSet (  ) 

Definition at line 1594 of file i_pm_impl.cpp.

References ipc_EXEC_m, log_FUNC_m, log_WriteEvent(), m_iRM, m_partName, m_recoveryMode, m_recoveryMode_x, and rmdb_PARTITION_RECOVERY_MODE.

Referenced by FSCRecovery(), and i_PartitionManager_i().

01594                                            {
01595     log_FUNC_m(RecoveryModeSet);
01596 
01597     cmn_MutexLock l(m_recoveryMode_x);
01598     log_WriteEvent("Entering Recovery Mode", m_partName);
01599     ipc_EXEC_m(
01600         m_iRM->SetPartitionStatus(rmdb_PARTITION_RECOVERY_MODE, m_partName.c_str());
01601     );
01602 
01603     m_recoveryMode = true;
01604 }

Here is the call graph for this function:

Here is the caller graph for this function:

void i_PartitionManager_i::RecoveryModeClear (  ) 

Definition at line 1607 of file i_pm_impl.cpp.

References ipc_EXEC_m, log_FUNC_m, log_WriteEvent(), m_iRM, m_partName, m_recoveryMode, m_recoveryMode_x, m_recoveryNeeded, and rmdb_PARTITION_RECOVERY_MODE.

Referenced by i_RecoveryJob_i::~i_RecoveryJob_i().

01607                                              {
01608     log_FUNC_m(RecoveryModeClear);
01609 
01610     cmn_MutexLock l(m_recoveryMode_x);
01611     log_WriteEvent("Exiting Recovery Mode", m_partName);
01612     ipc_EXEC_m(
01613         m_iRM->ClearPartitionStatus(rmdb_PARTITION_RECOVERY_MODE, m_partName.c_str());
01614     );
01615 
01616     m_recoveryMode = false;
01617     m_recoveryNeeded = false;
01618 }

Here is the call graph for this function:

Here is the caller graph for this function:

void i_PartitionManager_i::ClearRecoveryRunning (  ) 

Definition at line 1621 of file i_pm_impl.cpp.

References log_FUNC_m, m_recoveryMode, and m_recoveryMode_x.

Referenced by i_RecoveryJob_i::~i_RecoveryJob_i().

01621                                                 {
01622     log_FUNC_m(ClearRecoveryRunning);
01623 
01624     cmn_MutexLock l(m_recoveryMode_x);
01625 
01626     m_recoveryMode = false;
01627 }

Here is the caller graph for this function:

bool i_PartitionManager_i::RecoveryOfIVDFSSet (  ) 

Definition at line 1630 of file i_pm_impl.cpp.

References log_FUNC_m, m_recoveryOfIVDFS, and m_recoveryOfIVDFS_x.

Referenced by i_RecreatedIVDFSJob_i::Execute().

01630                                               {
01631     log_FUNC_m(RecoveryOfIVDFSSet);
01632 
01633     cmn_MutexLock l(m_recoveryOfIVDFS_x);
01634     if (m_recoveryOfIVDFS) {
01635         return false;
01636     }
01637 
01638     m_recoveryOfIVDFS = true;
01639     return true;
01640 }

Here is the caller graph for this function:

void i_PartitionManager_i::RecoveryOfIVDFSClear (  ) 

Definition at line 1643 of file i_pm_impl.cpp.

References log_FUNC_m, m_recoveryOfIVDFS, and m_recoveryOfIVDFS_x.

Referenced by i_RecreatedIVDFSJob_i::Execute().

01643                                                 {
01644     log_FUNC_m(RecoveryOfIVDFSClear);
01645 
01646     cmn_MutexLock l(m_recoveryOfIVDFS_x);
01647 
01648     m_recoveryOfIVDFS = false;
01649 }

Here is the caller graph for this function:

bool i_PartitionManager_i::IsRecoveryOfIVDFSRun (  )  [inline]

Definition at line 225 of file i_pm_impl.h.

References m_recoveryOfIVDFS.

00225 { return m_recoveryOfIVDFS; };

void i_PartitionManager_i::GetPartitionRecord (  ) 

Definition at line 1682 of file i_pm_impl.cpp.

References cfg_PMCfg::clients, dbg_LOW, ipc_EXEC_m, log_DBG_m, log_FUNC_m, log_NOTE_m, m_config, m_iRM, m_partName, m_rmPart, rm_Partition::migIdCount, rm_Partition::migIdTime, rm_Partition::options, rm_Partition::partitionName, rm_Partition::partitionUUIDString, rm_Partition::partUUID, and rm_Partition::status.

Referenced by FillClientCfg(), and i_PartitionManager_i().

01682                                               {
01683     log_FUNC_m(GetPartitionRecord);
01684 
01685     i_Partition_t_var part;
01686     ipc_EXEC_m(
01687         part = m_iRM->SelectPartition(m_partName.c_str());
01688     );
01689     m_rmPart.partitionName          = part->partitionName;
01690     m_rmPart.partitionUUIDString    = part->partitionUUIDString;
01691     m_rmPart.partUUID               = string(part->partitionUUIDString);
01692     m_rmPart.migIdCount             = part->migIdCount;
01693     m_rmPart.migIdTime              = part->migIdTime;
01694     m_rmPart.status                 = part->status;
01695     m_rmPart.options                = part->options;
01696 
01697 
01698     log_DBG_m(dbg_LOW, "part->options:" << part->options <<
01699                         ", m_rmPart.options:" << m_rmPart.options);
01700 
01701     if (m_rmPart.options != m_config.clients[0].operationMode){
01702         ostringstream msg;
01703         msg << "Operation mode for partition: " << m_partName <<
01704             " is ";
01705 
01706         msg << ivd_FSTypeToText(static_cast<ivd_FSType_e>(m_rmPart.options)) <<
01707             " in rmdb, but ";
01708 
01709         msg << ivd_FSTypeToText(static_cast<ivd_FSType_e>(m_config.clients[0].operationMode)) <<
01710             " in configuration file!";
01711         log_NOTE_m(msg.str());
01712     }
01713 } // i_PartitionManager_i::GetPartitionRecord()

Here is the caller graph for this function:

void i_PartitionManager_i::SetCheckAutoCorrectRunning (  ) 

Definition at line 1716 of file i_pm_impl.cpp.

References m_checkAutoCorrectRunning, and m_checkAutoCorrectRunning_x.

Referenced by i_MediumCheckJob_i::i_MediumCheckJob_i().

Here is the caller graph for this function:

void i_PartitionManager_i::ClearCheckAutoCorrectRunning (  ) 

Definition at line 1722 of file i_pm_impl.cpp.

References m_checkAutoCorrectRunning, and m_checkAutoCorrectRunning_x.

Referenced by i_MediumCheckJob_i::~i_MediumCheckJob_i().

01722                                                         {
01723     cmn_MutexLock l(m_checkAutoCorrectRunning_x);
01724     m_checkAutoCorrectRunning = false;
01725 }

Here is the caller graph for this function:

bool i_PartitionManager_i::GetCheckAutoCorrectRunning (  ) 

Definition at line 1728 of file i_pm_impl.cpp.

References m_checkAutoCorrectRunning, and m_checkAutoCorrectRunning_x.

Referenced by CheckFSCvsMedia(), FSCRecovery(), LimitedCheckFSCvsMedia(), Reorg(), ReorgByColId(), and ReorgScan().

Here is the caller graph for this function:

void i_PartitionManager_i::SetCheckRunning (  ) 

Definition at line 1734 of file i_pm_impl.cpp.

References m_checkRunning, and m_checkRunning_x.

Referenced by i_MediumCheckJob_i::i_MediumCheckJob_i().

01734                                            {
01735     cmn_MutexLock l(m_checkRunning_x);
01736     m_checkRunning = true;
01737 }

Here is the caller graph for this function:

void i_PartitionManager_i::ClearCheckRunning (  ) 

Definition at line 1740 of file i_pm_impl.cpp.

References m_checkRunning, and m_checkRunning_x.

Referenced by i_MediumCheckJob_i::~i_MediumCheckJob_i().

01740                                              {
01741     cmn_MutexLock l(m_checkRunning_x);
01742     m_checkRunning = false;
01743 }

Here is the caller graph for this function:

bool i_PartitionManager_i::GetCheckRunning (  ) 

Definition at line 1746 of file i_pm_impl.cpp.

References m_checkRunning, and m_checkRunning_x.

Referenced by CheckFSCvsMedia(), FSCRecovery(), and LimitedCheckFSCvsMedia().

01746                                            {
01747     cmn_MutexLock l(m_checkRunning_x);
01748     return m_checkRunning;
01749 }

Here is the caller graph for this function:

void i_PartitionManager_i::GetAllMediaWithPools ( fsc_MediumStatus_v ms  ) 

Definition at line 349 of file i_pm_impl.cpp.

References dbg_DETAIL, dbg_IsActive(), dbg_NORM, ie_FATAL_ERROR, log_DBG_m, log_FUNC_m, m_config, cfg_PM::m_globalTree, m_iRM, i_MediaPool_t::mediaPoolKey, i_Medium_t::mediaPoolName, i_MediaPool_t::mediaPoolName, i_Medium_t::mediumKey, i_Medium_t::mediumType, mt_DISK, cfg_Tree::pools, and i_Medium_t::status.

Referenced by CheckFSCvsIVDFS().

00349                                                                       {
00350     log_FUNC_m(GetAllMediaWithPools);
00351 
00352     i_MediumSeq_t_var medSeq;
00353     medSeq = m_iRM->SelectAllMedia();
00354     vector<i_MediaPool_t> &pools = m_config.m_globalTree.pools;
00355 
00356     UInt32_t maxMedKey(0);
00357     if (medSeq->length() == 0){
00358         ostringstream sstr;
00359         sstr << "No media found at all ???. ";
00360         throw ivd_InternalError(ie_FATAL_ERROR, sstr.str());
00361     } else {
00362         maxMedKey = medSeq[0].mediumKey;
00363     }
00364 
00365     for (UInt32_t i(1); i < medSeq->length(); ++i){
00366         if (medSeq[i].mediumKey > maxMedKey){
00367             maxMedKey = medSeq[i].mediumKey;
00368         }
00369     }
00370 
00371     // index is mediumKey
00372     // index 0 is redundant
00373     ms.resize(maxMedKey + 1);
00374     ostringstream msgBase;
00375     log_DBG_m(dbg_NORM, "" << msgBase << "ms resized to " << ms.size());
00376 
00377     log_DBG_m(dbg_DETAIL, "Num of pools " << pools.size());
00378     if (dbg_IsActive()) {
00379         for(UInt32_t j(0); j < pools.size(); ++j){
00380             i_MediaPool_t &pool = pools[j];
00381             log_DBG_m(dbg_DETAIL, j
00382                 << ". pool key " << pool.mediaPoolKey
00383                 << " mediaPoolName " << pool.mediaPoolName );
00384         }
00385     }
00386 
00387     for (UInt32_t i(0); i < medSeq->length(); ++i){
00388         i_Medium_t& med = medSeq[i];
00389         // get pool key
00390         UInt32_t poolKey(0);
00391         for(UInt32_t j(0); j < pools.size(); ++j){
00392             i_MediaPool_t &pool = pools[j];
00393             if (string(pool.mediaPoolName).compare(med.mediaPoolName) == 0){
00394                 poolKey = pool.mediaPoolKey;
00395             }
00396         }
00397         log_DBG_m(dbg_DETAIL, " medKey " << setw(4) << med.mediumKey
00398             << ". poolKey " << poolKey
00399             << ", med.status " << med.status
00400             << ", med.mediumType " << med.mediumType
00401             << ", med.mediaPoolName " << med.mediaPoolName );
00402 
00403         if (med.mediumKey == 0){
00404             ostringstream sstr;
00405             sstr << "mediumKey is zero. " << med.mediumKey;
00406             throw ivd_InternalError(ie_FATAL_ERROR, sstr.str());
00407         }
00408         if (med.mediumKey >= ms.size()){
00409             ostringstream sstr;
00410             sstr << "mediumKey is bigger than vector size. "
00411                 << med.mediumKey << " > " << ms.size();
00412             throw ivd_InternalError(ie_FATAL_ERROR, sstr.str());
00413         }
00414         log_DBG_m(dbg_DETAIL, "inserting  mediaKey:" << med.mediumKey);
00415         ms[med.mediumKey] = fsc_MediumStatus_t( poolKey,
00416             med.status,
00417             med.mediumType == mt_DISK ? 2:1);
00418         // Higher number better medium
00419     }
00420 } // i_PartitionManager_i::GetAllMediaWithPools()

Here is the call graph for this function:

Here is the caller graph for this function:

void i_PartitionManager_i::ParseConfig (  )  [private]

Definition at line 1287 of file i_pm_impl.cpp.

References BuildExpirationTree(), CFG_LINK_LATEST, ivd_Directories::cfgPart, cfg_PMCfg::clients, dbg_DETAIL, dbg_LOW, cmn_Global::dirs, el_Range, el_Simple, g_cmn, cfg_PMCfg::globalTreeOptions, ie_DATA_CORRUPTION, ie_NYI, ipc_EXEC_m, log_DBG_m, log_ERR_m, log_FUNC_m, log_WRN_m, m_config, m_externalClient, cfg_PM::m_globalTree, cmn_SysInfo::m_hostName, m_iRM, m_jobMgr, m_partName, cfg_PMCfg::maxNumDrives, cfg_PMCfg::maxNumDrivesMigration, cfg_PMCfg::maxNumDrivesRecall, cfg_PMCfg::maxNumDrivesReorg, cfg_PMCfg::migrationPriority, cfg_PMTree::name, cfg_Tree::name, pf_File::Parse(), cfg_PMCfg::partitionPriority, cfg_PMTree::pools, cfg_Tree::pools, cfg_PMCfg::recallPriority, cfg_PMCfg::Refresh(), cfg_PMCfg::reserveNumDrives, cfg_PMCfg::reserveNumDrivesMigration, cfg_PMCfg::reserveNumDrivesRecall, cfg_PMCfg::reserveNumDrivesReorg, job_Manager::SetMaxRunningJobs(), and cmn_Global::si.

Referenced by i_PartitionManager_i(), and RefreshCfg().

01287                                        {
01288     log_FUNC_m(ParseConfig);
01289 
01290     cmn_Path cfgFile = g_cmn.dirs.cfgPart + m_partName + string(CFG_LINK_LATEST);
01291 
01292     // Reread configuration file
01293     {
01294         pf_File pmPF;
01295         pmPF.Parse(cfgFile);
01296 
01297         log_DBG_m(dbg_DETAIL,"got PM Job Manager configuration" );
01298 
01299         m_config.Refresh(pmPF);
01300     }
01301     log_DBG_m(dbg_DETAIL,"migration job priority in pmjobmgr is: " << m_config.migrationPriority);
01302 
01303     if (m_config.clients.size() < 1) {
01304         log_ERR_m("No clients configured.");
01305     }
01306     else if (m_config.clients.size() > 1) {
01307         log_WRN_m("Multiple clients configured! Unsupported configuration.");
01308     }
01309     else {
01310         string& cltHost = m_config.clients.at(0).name;
01311 
01312         if (g_cmn.si.m_hostName != cltHost) {
01313             log_DBG_m(dbg_LOW, "Client " << cltHost << " is EXTERNAL.");
01314             m_externalClient = true;
01315         }
01316         else {
01317             log_DBG_m(dbg_LOW, "Client " << cltHost << " is LOCAL.");
01318             m_externalClient = false;
01319         }
01320     }
01321     log_DBG_m(dbg_DETAIL, "recallOnly:" <<
01322                             m_config.clients[0].disableAutMig);
01323 
01324     m_config.m_globalTree.pools.clear();
01325     log_DBG_m(dbg_DETAIL,"Cleared old pools");
01326     m_config.m_globalTree.name          = m_config.globalTreeOptions.name;
01327 
01328     for (UInt32_t i = 0; i < m_config.globalTreeOptions.pools.size(); i++){
01329         if (m_config.globalTreeOptions.pools[i].Type() == el_Simple ){
01330             string pName;
01331             pName = m_config.globalTreeOptions.pools[i].Val();
01332             i_MediaPool_t_var iMp;
01333             ipc_EXEC_m(
01334                 log_DBG_m(dbg_DETAIL,"will select pool with name : " << pName);
01335 
01336                 iMp = m_iRM->SelectMediaPool(pName.c_str());
01337                 // mp.SelectByName(pName);
01338 
01339             );
01340             m_config.m_globalTree.pools.push_back(iMp);
01341 
01342         } else if (m_config.globalTreeOptions.pools[i].Type() == el_Range){
01343 
01344             throw ivd_InternalError(
01345                 ie_NYI, "Range of MediaPools is not yet implmented");
01346 
01347         } else {
01348             throw ivd_InternalError(
01349                 ie_DATA_CORRUPTION, "no element type for pool in cfgPM config type");
01350         }
01351     };
01352     BuildExpirationTree();
01353 
01358     log_DBG_m(dbg_DETAIL,"" << endl <<
01359         "Partition running with following parameters:" << endl <<
01360         "   globalTreeOptions.pools.size()" << m_config.globalTreeOptions.pools.size() << endl <<
01361         "   maxNumDrives                " << m_config.maxNumDrives              << endl <<
01362         "   maxNumDrivesMigration       " << m_config.maxNumDrivesMigration     << endl <<
01363         "   maxNumDrivesRecall          " << m_config.maxNumDrivesRecall        << endl <<
01364         "   maxNumDrivesReorg           " << m_config.maxNumDrivesReorg         << endl <<
01365         "   migrationPriority           " << m_config.migrationPriority         << endl <<
01366         "   partitionPriority           " << m_config.partitionPriority         << endl <<
01367         "   recallPriority              " << m_config.recallPriority            << endl <<
01368         "   reserveNumDrives            " << m_config.reserveNumDrives          << endl <<
01369         "   reserveNumDrivesMigration   " << m_config.reserveNumDrivesMigration << endl <<
01370         "   reserveNumDrivesRecall      " << m_config.reserveNumDrivesRecall    << endl <<
01371         "   reserveNumDrivesReorg       " << m_config.reserveNumDrivesReorg     << endl
01372         );
01373 
01374     UInt32_t jobLimit(m_config.maxNumDrives * 3 / 2);
01375 
01376     m_jobMgr.SetMaxRunningJobs(jobLimit);
01377 } // i_PartitionManager_i::ParseConfig()

Here is the call graph for this function:

Here is the caller graph for this function:

i_ClientConf_t * i_PartitionManager_i::FillClientCfg (  )  [private]

Definition at line 1386 of file i_pm_impl.cpp.

References cfg_PMCfg::alternateDataPath, cfg_PMCfg::clients, cfg_PMCfg::criticalWaterMark, dbg_DETAIL, evt_WARNING, cfg_PMCfg::fileHeaderSize, fst_REGULAR, fst_WORM, GetPartitionRecord(), cfg_PMCfg::hashSize, cfg_PMCfg::highWaterMark, i_FST_REGULAR, i_FST_WORM, ie_NYI, ivd_Error, log_DBG_m, log_FUNC_m, log_WriteEvent(), log_WRN_m, cfg_PMCfg::lowWaterMark, m_config, m_maxDiskBuff, m_recoveryOfIVDFS, m_rmPart, cfg_PMCfg::maxMigSize, cfg_PMCfg::maxNumMigFiles, cfg_PMCfg::maxWaitTime, cfg_PMCfg::migRetentionTime, cfg_PMCfg::minFileAge, cfg_PMCfg::minFileSize, cfg_PMCfg::minMigSize, cfg_PMCfg::minNumMigFiles, cfg_PMCfg::minWaitTime, cfg_PMCfg::name, rm_Partition::partitionUUIDString, cfg_PMCfg::recallRetentionTime, cfg_PMCfg::recallTimeOut, cfg_PMCfg::releaseExcludeFile, and cfg_PMCfg::releaseInterval.

Referenced by RefreshCfg(), and RegisterHSM().

01386                                                     {
01387     log_FUNC_m(FillClientCfg);
01388 
01389     i_ClientConf_t_var cfgClient(new i_ClientConf_t);
01390 
01391     cfgClient->CfgFileHeaderSize     = m_config.fileHeaderSize;
01392     cfgClient->CfgHashSize           = m_config.hashSize;
01393     cfgClient->CfgMaxMigSize         = m_config.maxMigSize;
01394     cfgClient->CfgMinMigSize         = m_config.minMigSize;
01395 
01396     if (cfgClient->CfgMaxMigSize > m_maxDiskBuff/2) {
01397         ostringstream msg;
01398         msg << "MaxMigSize is larger than half of the biggest file system for disk buffer.";
01399         msg << " Reducing MaxMigSize to " << m_maxDiskBuff/2;
01400         log_WriteEvent(evt_WARNING, msg.str());
01401         cfgClient->CfgMaxMigSize = m_maxDiskBuff/2;
01402         if (cfgClient->CfgMinMigSize >= cfgClient->CfgMaxMigSize) {
01403             cfgClient->CfgMinMigSize = cfgClient->CfgMaxMigSize/2;
01404             msg.str("");
01405             msg << "MinMigSize is larger than MaxMigSize.";
01406             msg << " Reducing MinMigSize to " << cfgClient->CfgMinMigSize;
01407             log_WriteEvent(evt_WARNING, msg.str());
01408         }
01409     }
01410 
01411 
01412     cfgClient->CfgMaxNumFiles        = m_config.maxNumMigFiles;
01413     cfgClient->CfgMaxWaitTime        = m_config.maxWaitTime;
01414     cfgClient->CfgMFAge              = m_config.minFileAge;
01415     cfgClient->CfgMinNumFiles        = m_config.minNumMigFiles;
01416     cfgClient->CfgMinWaitTime        = m_config.minWaitTime;
01417     cfgClient->CfgHighWaterMark      = m_config.highWaterMark;
01418     cfgClient->CfgLowWaterMark       = m_config.lowWaterMark;
01419     cfgClient->CfgCriticalWaterMark  = m_config.criticalWaterMark;
01420     cfgClient->CfgReleaseInterval    = m_config.releaseInterval;
01421     cfgClient->CfgMigRetentionTime   = m_config.migRetentionTime;
01422     cfgClient->CfgRecallRetentionTime= m_config.recallRetentionTime;
01423     cfgClient->CfgMinFileSize        = m_config.minFileSize;
01424     cfgClient->CfgChunkSize          = 0;
01425     cfgClient->CfgPartitionName      = CORBA::string_dup( m_config.name.c_str() );
01426     cfgClient->CfgPartitionUUID      = CORBA::string_dup( m_rmPart.partitionUUIDString.c_str() );
01427     cfgClient->CfgRecallTimeOut      = m_config.recallTimeOut;
01428     cfgClient->CfgRecoveryOfIVDFS    = m_recoveryOfIVDFS;
01429     cfgClient->CfgAlternateDataPath  = CORBA::string_dup( m_config.alternateDataPath.c_str() );
01430 
01431     cfgClient->CfgExcludeFromRelease.length(m_config.releaseExcludeFile.size());
01432     for (UInt32_t item = 0; item < m_config.releaseExcludeFile.size(); item++) {
01433         cfgClient->CfgExcludeFromRelease[item]
01434             = CORBA::string_dup( m_config.releaseExcludeFile[item].Val().c_str() );
01435     }
01436 
01437     /*  ZJ - not needed/used by client
01438     cfgClient->CfgDelete.length(m_config.deleteFile.size());
01439     for (UInt32_t item = 0; item < m_config.deleteFile.size(); item++) {
01440         cfgClient->CfgDelete[item].fileAge = m_config.deleteFile[item].m_fileAge;
01441         cfgClient->CfgDelete[item].pathList.length(m_config.deleteFile[item].m_pathList.size());
01442         for (UInt32_t ui = 0; ui < m_config.deleteFile[item].m_pathList.size(); ui++) {
01443             cfgClient->CfgDelete[item].pathList[ui] =
01444                 CORBA::string_dup( m_config.deleteFile[item].m_pathList[ui].Val().c_str() );
01445         }
01446     }
01447     */
01448 
01449     if (m_config.clients.size() != 1) {
01450         throw ivd_Error(ie_NYI,"Can handle only one client");
01451     }
01452 
01453     cfgClient->CfgWORMTimeout = m_config.clients[0].WORMTimeout;
01454 
01455     cfgClient->CfgRecallOnly = (m_config.clients[0].disableAutMig != 0);
01456 
01457     cfgClient->CfgReplTargetHost = CORBA::string_dup(m_config.clients[0].replTargHost.c_str());
01458     cfgClient->CfgReplTargetPart = CORBA::string_dup(m_config.clients[0].replTargPart.c_str());
01459 
01460     log_DBG_m(dbg_DETAIL, "recallOnly:" << m_config.clients[0].disableAutMig <<
01461                           ", replTargHost:" << m_config.clients[0].replTargHost <<
01462                           ", replTargPart:" << m_config.clients[0].replTargPart);
01463 
01464     if (cfgClient->CfgRecallOnly) {
01465         log_DBG_m(dbg_DETAIL, "setting minFileAge to 1s");
01466         cfgClient->CfgMFAge = 1;
01467     }
01468 
01469     GetPartitionRecord();
01470 
01471     switch (m_config.clients[0].operationMode){
01472         case(fst_REGULAR):  cfgClient->CfgOperationMode = i_FST_REGULAR; break;
01473         case(fst_WORM):     cfgClient->CfgOperationMode = i_FST_WORM; break;
01474         default:            log_WRN_m(  "FileSystem Type not specified "
01475                                         "in configuration file properly "
01476                                         "FSType set to REGULAR!");
01477                             cfgClient->CfgOperationMode = i_FST_REGULAR;
01478     }
01479 
01480     return cfgClient._retn();
01481 } // i_PartitionManager_i::FillClientCfg()

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class pm_JobMgr [friend]

Definition at line 59 of file i_pm_impl.h.


Member Data Documentation

Definition at line 195 of file i_pm_impl.h.

Referenced by SetReorgScan(), StartReorgJob(), and StopReorgJob().

Definition at line 210 of file i_pm_impl.h.

Referenced by i_PartitionManager_i().

Reimplemented from i_Component_i.

Definition at line 240 of file i_pm_impl.h.

i_ResourceManager_var i_PartitionManager_i::m_iRM

i_PartitionManager_var i_PartitionManager_i::m_iPM

Definition at line 249 of file i_pm_impl.h.

Referenced by i_PartitionManager_i(), and RegisterFSID().

Definition at line 250 of file i_pm_impl.h.

Referenced by GetFSC(), and i_PartitionManager_i().

Definition at line 256 of file i_pm_impl.h.

Referenced by i_PartitionManager_i(), and ~i_PartitionManager_i().

Definition at line 260 of file i_pm_impl.h.

Referenced by i_PartitionManager_i(), and RegisterHSM().

Definition at line 272 of file i_pm_impl.h.

Referenced by ClearCheckRunning(), GetCheckRunning(), and SetCheckRunning().

Definition at line 273 of file i_pm_impl.h.

Referenced by ClearCheckRunning(), GetCheckRunning(), and SetCheckRunning().

Definition at line 276 of file i_pm_impl.h.

Referenced by RecoveryOfIVDFSClear(), and RecoveryOfIVDFSSet().

Definition at line 277 of file i_pm_impl.h.

Referenced by BuildExpirationTree(), GetExpirationAge(), and GetExpirationTree().

Definition at line 279 of file i_pm_impl.h.

Referenced by RegisterHSM().


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

Generated on Mon Feb 27 19:37:16 2012 for OPENARCHIVE by  doxygen 1.5.6