pm_RecallClientThread Class Reference
[Partition Manager]

#include <i_recalljob_impl.h>

Inheritance diagram for pm_RecallClientThread:

Inheritance graph
[legend]
Collaboration diagram for pm_RecallClientThread:

Collaboration graph
[legend]

List of all members.


Detailed Description

Definition at line 36 of file i_recalljob_impl.h.


Public Member Functions

 pm_RecallClientThread (i_RecallJob_i &a_migJob)

Private Member Functions

 ~pm_RecallClientThread ()
virtual void Run (void *arg)

Private Attributes

i_RecallJob_im_recJob
i_DownloadAgent_var m_downloadAgent
i_CompletionStatus_e m_status
 log_CLASSID_m

Friends

class i_RecallJob_i

Constructor & Destructor Documentation

pm_RecallClientThread::pm_RecallClientThread ( i_RecallJob_i a_migJob  ) 

Definition at line 378 of file i_recalljob_impl.cpp.

References cmn_ThreadCounter::Inc(), log_FUNC_m, i_RecallJob_i::m_recallCounter, and m_recJob.

00379     : m_recJob(a_recJob){
00380     log_FUNC_m(pm_RecallClientThread);
00381     m_recJob.m_recallCounter.Inc();
00382 }

Here is the call graph for this function:

pm_RecallClientThread::~pm_RecallClientThread (  )  [private]

Definition at line 384 of file i_recalljob_impl.cpp.

References i_RecallJob_i::CompleteJob(), dbg_DETAIL, cmn_ThreadCounter::Dec(), log_DBG_m, log_FUNC_m, m_downloadAgent, i_RecallJob_i::m_recallCounter, m_recJob, and m_status.

00384                                              {
00385     log_FUNC_m(~pm_RecallClientThread);
00386 
00387     if (!CORBA::is_nil(m_downloadAgent)) {
00388         try {
00389             m_downloadAgent->Remove();
00390         }
00391         catch (...) {
00392             log_DBG_m(dbg_DETAIL, "m_downloadAgent->Remove() failed. Ignored.");
00393         };
00394     }
00395     m_recJob.m_recallCounter.Dec();
00396     m_recJob.CompleteJob(m_status);
00397 }

Here is the call graph for this function:


Member Function Documentation

void pm_RecallClientThread::Run ( void *  arg  )  [private, virtual]

Reimplemented from cmn_Thread.

Definition at line 399 of file i_recalljob_impl.cpp.

References i_JobParams::bufType, i_JobParams::diskBufferFS, dt_DISKBUF, g_cmn, i_Job_i::GetDiskBufferFileName(), i_PartitionManager_i::GetHSM(), i_Job_i::GetJobTypeText(), i_Job_i::GetResources(), i_SUCCEDED, ipc_EXEC_m, i_JobParams::jobID, log_FUNC_m, log_WriteEvent(), m_downloadAgent, i_PartitionManager_i::m_externalClient, cmn_SysInfo::m_hostName, i_RecallJob_i::m_hsmRecallCalled, i_Job_i::m_iJobParams, i_RecallJob_i::m_iPM, i_RecallJob_i::m_iRecall, m_recJob, m_status, ipc_Corba::ResolveSvc(), and cmn_Global::si.

00399                                           {
00400     log_FUNC_m(Run);
00401 
00402     try {
00403         if (m_recJob.m_iPM.m_externalClient) {
00404             ipc_EXEC_m(
00405                 CORBA::Object_var obj = ipc_Corba::ResolveSvc(g_cmn.si.m_hostName);
00406                 i_Service_var svc = i_Service::_narrow(obj);
00407                 i_DownloadAgent_var dagt = svc->CreateDownloadAgent(
00408                     dt_DISKBUF,
00409                     m_recJob.GetDiskBufferFileName().c_str() );
00410 
00411                 m_downloadAgent = i_DownloadAgent::_duplicate(dagt);
00412             );
00413         };
00414 
00415         ipc_EXEC_m(
00416             if (!m_recJob.m_hsmRecallCalled){
00417                 m_recJob.m_hsmRecallCalled = true;
00418                 m_recJob.m_iPM.GetHSM()->Recall(
00419                     m_recJob.m_iRecall,
00420                     m_recJob.m_iJobParams.jobID,
00421                     m_recJob.GetResources()[0].blockSize,
00422                     m_recJob.m_iJobParams.bufType,
00423                     m_recJob.m_iJobParams.diskBufferFS,
00424                     true,
00425                     m_downloadAgent );
00426             }
00427 
00428             if (!CORBA::is_nil(m_downloadAgent)) {
00429                 m_downloadAgent->Remove();
00430                 m_downloadAgent = i_DownloadAgent::_nil();
00431             };
00432         );
00433         log_WriteEvent("Finished.",
00434                         m_recJob.GetJobTypeText(), m_recJob.m_iJobParams.jobID);
00435         m_status = i_SUCCEDED;
00436     } catch (ivd_Exception &e){
00437         ostringstream os;
00438         os << "Failed (" << e.GetFriendly() << ").";
00439         log_WriteEvent(evt_ERROR, os.str(),
00440                        m_recJob.GetJobTypeText(), m_recJob.m_iJobParams.jobID);
00441         log_ERR_m(  "[" << m_recJob.m_iJobParams.jobID << "] " <<
00442                     "Caught Exception when calling HSM->Recall: " << e);
00443         m_status = i_FAILED;
00444     }
00445 
00446 }

Here is the call graph for this function:


Friends And Related Function Documentation

friend class i_RecallJob_i [friend]

Definition at line 37 of file i_recalljob_impl.h.


Member Data Documentation

Definition at line 48 of file i_recalljob_impl.h.

Referenced by pm_RecallClientThread(), Run(), and ~pm_RecallClientThread().

i_DownloadAgent_var pm_RecallClientThread::m_downloadAgent [private]

Definition at line 49 of file i_recalljob_impl.h.

Referenced by Run(), and ~pm_RecallClientThread().

Definition at line 50 of file i_recalljob_impl.h.

Referenced by Run(), and ~pm_RecallClientThread().

Reimplemented from cmn_Thread.

Definition at line 51 of file i_recalljob_impl.h.


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

Generated on Mon Feb 27 19:45:31 2012 for OPENARCHIVE by  doxygen 1.5.6