Public Member Functions | Private Member Functions | Private Attributes | Friends

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.

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

Detailed Description

Definition at line 50 of file i_recalljob_impl.h.


Constructor & Destructor Documentation

pm_RecallClientThread::pm_RecallClientThread ( i_RecallJob_i a_migJob  ) 

Definition at line 392 of file i_recalljob_impl.cpp.

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

Here is the call graph for this function:

pm_RecallClientThread::~pm_RecallClientThread (  )  [private]

Definition at line 398 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.

                                             {
    log_FUNC_m(~pm_RecallClientThread);

    if (!CORBA::is_nil(m_downloadAgent)) {
        try {
            m_downloadAgent->Remove();
        }
        catch (...) {
            log_DBG_m(dbg_DETAIL, "m_downloadAgent->Remove() failed. Ignored.");
        };
    }
    m_recJob.m_recallCounter.Dec();
    m_recJob.CompleteJob(m_status);
}

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 413 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(), 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.

                                          {
    log_FUNC_m(Run);

    try {
        if (m_recJob.m_iPM.m_externalClient) {
            ipc_EXEC_m(
                CORBA::Object_var obj = ipc_Corba::ResolveSvc(g_cmn.si.m_hostName);
                i_Service_var svc = i_Service::_narrow(obj);
                i_DownloadAgent_var dagt = svc->CreateDownloadAgent(
                    dt_DISKBUF,
                    m_recJob.GetDiskBufferFileName().c_str() );

                m_downloadAgent = i_DownloadAgent::_duplicate(dagt);
            );
        };

        ipc_EXEC_m(
            if (!m_recJob.m_hsmRecallCalled){
                m_recJob.m_hsmRecallCalled = true;
                m_recJob.m_iPM.GetHSM()->Recall(
                    m_recJob.m_iRecall,
                    m_recJob.m_iJobParams.jobID,
                    m_recJob.GetResources()[0].blockSize,
                    m_recJob.m_iJobParams.bufType,
                    m_recJob.m_iJobParams.diskBufferFS,
                    true,
                    m_downloadAgent );
            }

            if (!CORBA::is_nil(m_downloadAgent)) {
                m_downloadAgent->Remove();
                m_downloadAgent = i_DownloadAgent::_nil();
            };
        );
        log_WriteEvent("Finished.",
                        m_recJob.GetJobTypeText(), m_recJob.m_iJobParams.jobID);
        m_status = i_SUCCEDED;
    } catch (ivd_Exception &e){
        ostringstream os;
        os << "Failed (" << e.GetFriendly() << ").";
        log_WriteEvent(evt_ERROR, os.str(),
                       m_recJob.GetJobTypeText(), m_recJob.m_iJobParams.jobID);
        log_ERR_m(  "[" << m_recJob.m_iJobParams.jobID << "] " <<
                    "Caught Exception when calling HSM->Recall: " << e);
        m_status = i_FAILED;
    }

}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class i_RecallJob_i [friend]

Definition at line 51 of file i_recalljob_impl.h.


Member Data Documentation

Reimplemented from cmn_Thread.

Definition at line 65 of file i_recalljob_impl.h.

i_DownloadAgent_var pm_RecallClientThread::m_downloadAgent [private]

Definition at line 63 of file i_recalljob_impl.h.

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

Definition at line 62 of file i_recalljob_impl.h.

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

Definition at line 64 of file i_recalljob_impl.h.

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


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