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

i_RecallJob_i Class Reference
[Partition Manager]

#include <i_recalljob_impl.h>

Inheritance diagram for i_RecallJob_i:
Inheritance graph
[legend]
Collaboration diagram for i_RecallJob_i:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 i_RecallJob_i (i_PartitionManager_i &a_iPM, pm_JobMgr &a_jobMgr, i_Recall_t a_iRecall)
virtual void GetNewResources (i_Index_t a_resNum)
virtual void MediumOperationComplete (i_Index_t a_beaNum, i_CompletionStatus_e a_status)
virtual void CompleteJob (i_CompletionStatus_e a_status)
i_FileLocationDataList_tGetNextRecallSet ()
i_FSC_ptr GetFSC ()
virtual i_JobRequestList_tGetFiles ()

Public Attributes

ivd_FileSize_t m_fileSize

Protected Attributes

i_PartitionManager_im_iPM

Private Member Functions

virtual ~i_RecallJob_i ()
void Process ()
 Non-interface function.
void Execute ()
void PrepareResource ()
void CleanUp ()
void RecallRetry ()
void ReleaseResources ()

Private Attributes

i_MediumPos_v_t m_iCopiesPos
i_CopiesPos_v_t_var m_allCopiesPos
i_Recall_t m_iRecall
UInt32_t m_currentSplit
UInt32_t m_numOfSplits
bool m_beaGotSplit
pm_RecallClientThreadm_recallClientThread
cmn_ThreadCounter m_recallCounter
bool m_hsmRecallCalled
 log_CLASSID_m

Friends

class pm_RecallClientThread

Detailed Description

Definition at line 72 of file i_recalljob_impl.h.


Constructor & Destructor Documentation

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

Definition at line 102 of file i_recalljob_impl.cpp.

References log_FUNC_m, and i_Job_i::ReleaseDiskBuffer().

Here is the call graph for this function:

i_RecallJob_i::i_RecallJob_i ( i_PartitionManager_i a_iPM,
pm_JobMgr a_jobMgr,
i_Recall_t  a_iRecall 
)

Definition at line 52 of file i_recalljob_impl.cpp.

References i_JobParams::bufId, i_JobParams::bufType, i_JobParams::copies, rm_String::cvalue_p, i_Recall_t::fileID, i_Job_i::GetJobTypeText(), i_Job_i::InitBeaStatus(), ipc_EXEC_m, i_JobParams::jobID, i_JobParams::jobPriority, i_JobParams::jobType, log_FUNC_m, log_WriteEvent(), i_Job_i::m_activeBeas, i_PartitionManager_i::m_config, i_PartitionManager_i::m_externalClient, i_Job_i::m_iJobParams, m_iPM, m_iRecall, i_PartitionManager_i::m_rmPart, cfg_PMCfg::name, rm_Partition::partitionUUIDString, i_JobParams::partName, i_JobParams::partUUID, cfg_PMCfg::recallPriority, ipc_Init::ResourceInit(), and i_Job_i::SetResources().

        :   i_Job_i(a_jobMgr),
            m_fileSize(0),
            m_iPM(a_iPM),
            m_iRecall(a_iRecall),
            m_currentSplit(0),
            m_numOfSplits(0),
            m_beaGotSplit(false),
            m_hsmRecallCalled(false){
    log_FUNC_m(i_RecallJob_i);

    ostringstream os;
    os << "Started. ";

    m_iJobParams.jobType = jt_RECALL;
    log_WriteEvent(os.str(), GetJobTypeText(), m_iJobParams.jobID);

    ipc_EXEC_m(
        m_iJobParams.jobPriority   = m_iPM.m_config.recallPriority;
        m_iJobParams.partName      =
            CORBA::string_dup(m_iPM.m_config.name.c_str());
        m_iJobParams.partUUID      =
            CORBA::string_dup(m_iPM.m_rmPart.partitionUUIDString.cvalue_p);
    );

    if (m_iPM.m_externalClient) {
        m_iJobParams.bufType  = i_REMOTE_BUF;
    }
    else {
        m_iJobParams.bufType  = i_DISK_BUF;
    }
    m_iJobParams.bufId         = m_iJobParams.jobID;
    m_iJobParams.copies        = 0;

    i_ResourceList_t resources;
    resources.length(1);

    ipc_Init::ResourceInit(resources[0]); //sets all memebers to 0 or to ipc_nilStr
    resources[0].fileId     = m_iRecall.fileID;
    SetResources(resources);

    m_activeBeas.resize(1); //recall has always one Bea
    InitBeaStatus(1);
}

Here is the call graph for this function:


Member Function Documentation

void i_RecallJob_i::CleanUp (  )  [private]
void i_RecallJob_i::CompleteJob ( i_CompletionStatus_e  a_status  )  [virtual]

Implements i_Job_i.

Definition at line 333 of file i_recalljob_impl.cpp.

References i_JobParams::bufType, dbg_LOW, i_JobParams::diskBufferFS, i_Recall_t::fileID, i_Recall_t::fileSize, i_PartitionManager_i::GetHSM(), i_Job_i::GetResources(), i_SUCCEDED, ipc_EXEC_m, i_JobParams::jobID, log_DBG_m, log_ERR_m, log_FUNC_m, ipc_Log::LogStatus(), m_hsmRecallCalled, i_Job_i::m_iJobParams, m_iPM, m_iRecall, m_recallCounter, i_Recall_t::migrationID, i_Job_i::Remove(), and cmn_ThreadCounter::WaitAllEnd().

Referenced by MediumOperationComplete(), RecallRetry(), and pm_RecallClientThread::~pm_RecallClientThread().

                                                            {
    log_FUNC_m(CompleteJob);

    try {
        log_DBG_m(dbg_LOW, "[" << m_iJobParams.jobID << "] " <<
            "Waiting for Recall thread." )
            m_recallCounter.WaitAllEnd();
        log_DBG_m(dbg_LOW, "[" << m_iJobParams.jobID << "] " <<
            "~i_RecallJob_i finished" );

        if ( a_status == i_SUCCEDED ){
            ipc_EXEC_m(Remove(););
        } else {
            //job failed!!
            //todo inform client about fail
            log_ERR_m(
                "[" << m_iJobParams.jobID << "] " <<
                "Could not recall fileID: " << m_iRecall.fileID << 
                ", migID: " << m_iRecall.migrationID << 
                ", size: " << m_iRecall.fileSize << 
                ", status: " << ipc_Log::LogStatus(a_status));

            try {
                ipc_EXEC_m(
                    if (!m_hsmRecallCalled){
                        m_hsmRecallCalled = true;
                        m_iPM.GetHSM()->Recall(
                            m_iRecall,
                            m_iJobParams.jobID,
                            GetResources()[0].blockSize,
                            m_iJobParams.bufType,
                            m_iJobParams.diskBufferFS,
                            false,
                            i_DownloadAgent::_duplicate(i_DownloadAgent::_nil()) );
                    };
                );
            }
            catch (ivd_Exception &ie) {
                log_DBG_m(dbg_LOW, ie);
            }
            catch (...){
                log_DBG_m(dbg_LOW, "unknown exception caught");
                //ignore
            }
            //remove job
            ipc_EXEC_m(Remove(););
        }

    } catch (ivd_Exception& e) {
        log_ERR_m("[" << m_iJobParams.jobID <<"] " << e);
    } catch (ivd_InternalError& ie) {
        log_ERR_m("[" << m_iJobParams.jobID << "] " << ie);
    } catch (...) {
        log_ERR_m("[" << m_iJobParams.jobID << "] " << "Caught unknown" );
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void i_RecallJob_i::Execute (  )  [private, virtual]

Implements i_Job_i.

Definition at line 562 of file i_recalljob_impl.cpp.

References cmn_Num2Str(), dbg_DETAIL, dbg_LOW, evt_ERROR, i_Recall_t::fileID, i_Recall_t::fileSize, ivd_BaseException::GetFriendly(), i_PartitionManager_i::GetFSC(), i_Job_i::GetJobTypeText(), ie_NO_COPIES, ipc_EXEC_m, i_Job_i::IsAborted(), i_Job_i::IsFinished(), ivd_Error, i_JobParams::jobID, log_DBG_m, log_ERR_m, log_FUNC_m, log_WriteEvent(), i_Job_i::m_activate_x, m_allCopiesPos, i_Job_i::m_iJobParams, m_iPM, m_iRecall, i_Job_i::m_status, i_Recall_t::migrationID, i_Job_i::NeedsProcess(), PrepareResource(), Process(), and i_Job_i::WaitBeasToFinish().

                            {
    log_FUNC_m(Execute);

    log_DBG_m(dbg_DETAIL,"[" << m_iJobParams.jobID <<
                          "] " << "Running Recall job for FileID: " <<
                          m_iRecall.fileID);
    try {

        try {
            ipc_EXEC_m(
                i_FSC_var fsc = m_iPM.GetFSC();
                m_allCopiesPos = fsc->GetCopiesPos(
                                        m_iRecall.fileID,
                                        m_iRecall.migrationID,
                                        m_iRecall.fileSize );
            );

            UInt64_t fileID = m_iRecall.fileID;
            if (m_allCopiesPos->length() == 0) {
                throw ivd_Error(ie_NO_COPIES,
                                    "No copies for fileId:"+
                                    cmn_Num2Str(fileID));
            }

            for (UInt32_t i = 0; i < m_allCopiesPos->length(); i++) {
                if (m_allCopiesPos[i].length() == 0){
                    throw ivd_Error(ie_NO_COPIES,
                                    "Copies Are empty for fileId:"+
                                    cmn_Num2Str(fileID));
                }
            }
        } catch (ivd_Exception& e){

            log_ERR_m("[" << m_iJobParams.jobID << "] " <<
                      "GetFileCopies from FSC failed:" << e);

            ostringstream os;
            os << "Failed (" << e.GetFriendly() << ").";
            log_WriteEvent(evt_ERROR, os.str(),
                           GetJobTypeText(), m_iJobParams.jobID);
            m_status = i_FSC_ERROR;
            throw;
        }

        cmn_MutexLock l(m_activate_x);
        PrepareResource();

        if (IsAborted()) {
            return;
        }

        while ( !IsFinished() ) {
            WaitBeasToFinish(5);

            if (IsAborted()) {
                return;
            }

            if (NeedsProcess(0)) {
                Process();
            }
        }
    } catch (ivd_Exception& e){
        log_DBG_m(dbg_LOW, e);
        m_status = i_FAILED;
        throw;
    }
}

Here is the call graph for this function:

i_JobRequestList_t * i_RecallJob_i::GetFiles ( void   )  [virtual]

Implements i_Job_i.

Definition at line 639 of file i_recalljob_impl.cpp.

References ie_IMPOSSIBLE, and log_FUNC_m.

                                           {
    log_FUNC_m(GetFiles);

    try {
        throw ivd_InternalError(ie_IMPOSSIBLE);
    } ipc_CATCH_IVD_THROW_CORBA_m;
    return NULL;
} // i_RecallJob_i::GetFiles()

i_FSC_ptr i_RecallJob_i::GetFSC ( void   )  [virtual]

Implements i_Job_i.

Definition at line 463 of file i_recalljob_impl.cpp.

References i_PartitionManager_i::GetFSC(), ipc_EXEC_m, log_FUNC_m, and m_iPM.

                                {
    log_FUNC_m(GetFSC);
    try {
        ipc_EXEC_m(
            i_FSC_ptr tmpFSC = i_FSC::_duplicate(m_iPM.GetFSC());
            return tmpFSC;
        );
    } ipc_CATCH_IVD_THROW_CORBA_m;

}

Here is the call graph for this function:

void i_RecallJob_i::GetNewResources ( i_Index_t  a_resNum  )  [virtual]

Implements i_Job_i.

Definition at line 632 of file i_recalljob_impl.cpp.

References ie_IMPOSSIBLE, and log_FUNC_m.

                                                     {
    log_FUNC_m(GetNewResources);
    try {
        throw ivd_InternalError(ie_IMPOSSIBLE);
    } ipc_CATCH_IVD_THROW_CORBA_m;
}

i_FileLocationDataList_t * i_RecallJob_i::GetNextRecallSet (  )  [virtual]

Reimplemented from i_Job_i.

Definition at line 107 of file i_recalljob_impl.cpp.

References i_Recall_t::fileID, ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, m_beaGotSplit, m_currentSplit, m_iCopiesPos, i_Job_i::m_iJobParams, m_iRecall, i_Recall_t::migrationID, and i_JobParams::phase.

                                                         {
    log_FUNC_m(GetNextRecallSet);
    try {

        m_iJobParams.phase++;
        i_FileLocationDataList_t* splitLocation = new i_FileLocationDataList_t;

        if (m_beaGotSplit){
            return splitLocation;
        }

        splitLocation->length(1);
        //fill split info

        (*splitLocation)[0].fileID = m_iRecall.fileID;
        (*splitLocation)[0].blockOffset = m_iCopiesPos[m_currentSplit].blockOffset;
        (*splitLocation)[0].migrationID = m_iRecall.migrationID;
        (*splitLocation)[0].splitSize = m_iCopiesPos[m_currentSplit].splitSize;

        m_beaGotSplit = true;
        return splitLocation;
    } ipc_CATCH_IVD_THROW_CORBA_m
}

void i_RecallJob_i::MediumOperationComplete ( i_Index_t  a_beaNum,
i_CompletionStatus_e  a_status 
) [virtual]

Implements i_Job_i.

Definition at line 181 of file i_recalljob_impl.cpp.

References i_Resource_t::blockOffset, cmn_Condition::Broadcast(), bs_RUNNING, CompleteJob(), dbg_DETAIL, dbg_NORM, i_Job_i::GetResources(), i_FAILED, i_HW_ERROR, i_MEDIUM_ERROR, i_RESOURCE_ERROR, i_SUCCEDED, ie_FATAL_ERROR, ipc_EXEC_m, i_Job_i::IsAborted(), job_POST_MED_PROC, i_JobParams::jobID, log_DBG_m, log_ERR_m, log_FUNC_m, ipc_Log::LogStatus(), i_Job_i::m_activate_c, i_Job_i::m_activate_x, m_beaGotSplit, i_Job_i::m_beasStatus_x, m_currentSplit, m_iCopiesPos, i_Job_i::m_iJob, i_Job_i::m_iJobParams, m_recallClientThread, i_Job_i::m_rm, i_Resource_t::mediumKey, i_Resource_t::medVolNr, pm_RecallClientThread, RecallRetry(), ReleaseResources(), i_Resource_t::resAllocated, i_Resource_t::resAssigned, i_Resource_t::resProcessed, i_Job_i::SetBeaStatus(), i_Job_i::SetDiskBufferWritten(), i_Job_i::SetResMedOpComplete(), i_Job_i::SetResources(), i_Job_i::SetStatus(), i_Resource_t::splitOffset, and cmn_Thread::Start().

                                                      {

    log_FUNC_m(MediumOperationComplete);

    {
        cmn_MutexLock l(m_beasStatus_x);
        SetBeaStatus(a_beaNum, bs_RUNNING);
    }

    log_DBG_m(dbg_NORM,
        "[" << m_iJobParams.jobID << "] " <<
        "Recall CompleteJob called by Bea: " <<
        a_beaNum << "  status: " <<
        ipc_Log::LogStatus(a_status) );

    m_beaGotSplit = false;
    SetDiskBufferWritten();

    try {
        if ( (a_status == i_MEDIUM_ERROR) || (a_status == i_HW_ERROR) ){
            i_ResourceList_t tmpRes = GetResources();
            RecallRetry();
            cmn_MutexLock l(m_activate_x);
            m_activate_c.Broadcast();
            try {
                ipc_EXEC_m(m_rm->ReleaseResource(m_iJobParams, tmpRes));
            }
            catch (ivd_Error &e) {
                log_ERR_m("Releasing FAILED for jobID: " << 
                    m_iJobParams.jobID << endl << e)
            }
            return;
        }
        else {
            if (IsAborted()) return;
            if ( a_status != i_SUCCEDED ) {
                CompleteJob(i_FAILED);
                return;
            };
        };

        SetResMedOpComplete(a_beaNum);
        if (m_currentSplit == m_iCopiesPos.length() - 1){
            SetStatus(job_POST_MED_PROC);
            ReleaseResources();
            m_recallClientThread = new pm_RecallClientThread(*this);
            m_recallClientThread->Start();
        }
        else {
            //process next split
            m_currentSplit++;

            log_DBG_m(dbg_DETAIL,"[" << m_iJobParams.jobID <<
                "] " << "Set m_currentSplit to " << m_currentSplit);

            if (m_currentSplit >= m_iCopiesPos.length()){
                throw ivd_InternalError(ie_FATAL_ERROR, "Recall for unexisting split invoked");
            }
            try {
                i_Resource_t relRes;
                relRes = GetResources()[0];

                if (m_currentSplit >= m_iCopiesPos.length()){
                    throw ivd_InternalError(ie_FATAL_ERROR, "Recall for unexisting split invoked");
                }

                i_Resource_t tmpRes;
                tmpRes = GetResources()[0];
                log_DBG_m(dbg_DETAIL,"[" << m_iJobParams.jobID <<
                    "] " << "Got Resources[0]");

                tmpRes.mediumKey = m_iCopiesPos[m_currentSplit].mediumKey;
                tmpRes.medVolNr = m_iCopiesPos[m_currentSplit].medVolNum;
                tmpRes.blockOffset = m_iCopiesPos[m_currentSplit].blockOffset;
                tmpRes.splitOffset = m_iCopiesPos[m_currentSplit].splitOffset;

                tmpRes.resAllocated = false;
                tmpRes.resAssigned  = false;
                tmpRes.resProcessed = false;

                SetResources(tmpRes);

                ipc_EXEC_m(m_rm->ExchangeRecallResources(m_iJob,
                    m_iJobParams,
                    relRes,
                    GetResources()[0]););
            } catch (ivd_Exception& e){
                log_ERR_m("[" << m_iJobParams.jobID <<
                    "] " << "Catched Exception when calling RM: " << e);
                CompleteJob(i_RESOURCE_ERROR);
            }
        }
    } ipc_CATCH_IVD_THROW_CORBA_m;
}

Here is the call graph for this function:

void i_RecallJob_i::PrepareResource (  )  [private]

Second step RM-> ask for resources

Definition at line 474 of file i_recalljob_impl.cpp.

References i_Resource_t::barcode, i_Resource_t::blockOffset, i_MediumPos_t::blockOffset, i_MediumPos_t::dataType, dbg_DETAIL, dbg_LOW, dbg_NORM, i_Job_i::GetResources(), ie_FATAL_ERROR, ipc_EXEC_m, job_MED_PROC, i_JobParams::jobID, log_DBG_m, log_ERR_m, log_FUNC_m, m_allCopiesPos, m_currentSplit, m_fileSize, m_iCopiesPos, i_Job_i::m_iJob, i_Job_i::m_iJobParams, m_iPM, i_PartitionManager_i::m_maxDiskBuff, m_numOfSplits, i_Job_i::m_rm, i_Job_i::m_status, i_Resource_t::mediumKey, i_MediumPos_t::mediumKey, i_Resource_t::medVolNr, i_MediumPos_t::medVolNum, i_Job_i::RequestDiskBuffer(), i_Resource_t::resRequested, i_Job_i::SetResources(), i_Job_i::SetStatus(), i_Resource_t::splitOffset, i_MediumPos_t::splitOffset, and i_MediumPos_t::splitSize.

Referenced by Execute(), and RecallRetry().

                                   {
    log_FUNC_m(PrepareResource);

    try {
        log_DBG_m(dbg_LOW,"[" << m_iJobParams.jobID <<
            "] " << "Getting best copy from RM");
        UInt32_t bestCopyIdx = 0;
        ipc_EXEC_m(
            bestCopyIdx = m_rm->GetBestCopy(m_allCopiesPos);
        );
        log_DBG_m(dbg_DETAIL,   "[" << m_iJobParams.jobID <<
            "] " << "Got best copy from RM index:" <<
            bestCopyIdx);

        m_iCopiesPos = m_allCopiesPos[bestCopyIdx];


        log_DBG_m(dbg_DETAIL,"[" << m_iJobParams.jobID <<
            "] [DataType:MedVolNum:MediumKey:BlockOffset:SplitOffset:SplitSize]");

        if (m_iCopiesPos.length() == 0) {
            throw ivd_InternalError(ie_FATAL_ERROR, "Copying of copyPosition failed");
        }
        for (UInt32_t i = 0; i < m_iCopiesPos.length(); i++){
            i_MediumPos_t &mp = m_iCopiesPos[i];
            log_DBG_m(dbg_DETAIL,"[" << m_iJobParams.jobID <<
                                 "] " << "m_iCopiesPos[" << i << "],  " <<
                                 mp.dataType <<  "," <<
                                 mp.medVolNum << "," <<
                                 mp.mediumKey << "," <<
                                 mp.blockOffset << "," <<
                                 mp.splitOffset << "," <<
                                 mp.splitSize);
            m_fileSize += m_iCopiesPos[i].splitSize;
        }
        //reserver diskbuffer space
        UInt64_t allocated(0);
        RequestDiskBuffer(m_fileSize, m_fileSize, allocated, m_iPM.m_maxDiskBuff);

        m_numOfSplits = m_iCopiesPos.length();

        log_DBG_m(dbg_NORM,"[" << m_iJobParams.jobID <<
            "] " << "currentSplit:" << m_currentSplit <<
            " mediumKey:" <<
            m_iCopiesPos[m_currentSplit].mediumKey <<
            " medVolNr:" <<
            m_iCopiesPos[m_currentSplit].medVolNum);

        SetStatus(job_MED_PROC);

        i_Resource_t tmpRes;
        tmpRes = GetResources()[0];
        try {
            ipc_EXEC_m (
                i_MediumVol_t_var medVol =
                    m_rm->SelectMediumVolByKey(
                            m_iCopiesPos[m_currentSplit].mediumKey,
                            m_iCopiesPos[m_currentSplit].medVolNum
                    );
                tmpRes.barcode= medVol->mediumBarcode;
            );
        } catch (ivd_Error &e){
            log_ERR_m(e);
        }
        tmpRes.mediumKey    = m_iCopiesPos[m_currentSplit].mediumKey;
        tmpRes.medVolNr     = m_iCopiesPos[m_currentSplit].medVolNum;
        tmpRes.blockOffset  = m_iCopiesPos[m_currentSplit].blockOffset;
        tmpRes.splitOffset  = m_iCopiesPos[m_currentSplit].splitOffset;
        tmpRes.resRequested = true;
        SetResources(tmpRes);

        log_DBG_m(dbg_LOW,"[" << m_iJobParams.jobID <<
            "] " << "Getting Recall Resources from RM");
        ipc_EXEC_m(
            m_rm->GetRecallResources(   m_iJob,
                                        m_iJobParams,
                                        GetResources()[0]);
        );

    } catch (ivd_Exception& e){
        log_DBG_m(dbg_LOW, e);
        m_status = i_RMCOPYPOS_ERROR;
        throw;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void i_RecallJob_i::Process (  )  [private]

Non-interface function.

Definition at line 134 of file i_recalljob_impl.cpp.

References i_Job_i::ActivateBea(), i_Resource_t::blockOffset, bs_PROCESSING, bs_RUNNING, ivd_BaseException::GetError(), i_Job_i::GetResources(), ie_MEDIUM_HWERR, ie_MEDIUM_MEDERR, ie_MEDIUM_PROTECTED, ie_SCSI_HOST, ipc_EXEC_m, i_Job_i::IsAborted(), i_JobParams::jobID, i_Job_i::LoadUnload(), log_ERR_m, log_FUNC_m, i_Job_i::m_activeBeas, i_Job_i::m_beasStatus_x, m_currentSplit, m_iCopiesPos, i_Job_i::m_iJobParams, i_Job_i::m_rm, i_Resource_t::medVolId, i_Resource_t::medVolNr, RecallRetry(), ReleaseResources(), i_Job_i::SetBeaStatus(), i_Job_i::SetResources(), and i_Job_i::SetResProcessed().

Referenced by Execute().

                           {
    log_FUNC_m(Process);

    i_Resource_t tmpRes = GetResources()[0];
    tmpRes.medVolNr = m_iCopiesPos[m_currentSplit].medVolNum;

    i_MediumVol_t_var iMV;
    ipc_EXEC_m( iMV = m_rm->SelectMediumVolByKey(GetResources()[0].mediumKey,
                                                 GetResources()[0].medVolNr););

    tmpRes.blockOffset = m_iCopiesPos[m_currentSplit].blockOffset;
    tmpRes.medVolId = iMV->medVolId;
    SetResources(tmpRes);

    LoadUnload(0);

    try {
        cmn_MutexLock l(m_beasStatus_x);
        ipc_EXEC_m(ActivateBea(0););
        SetBeaStatus(0, bs_RUNNING);

        if (IsAborted()){
            return;
        }
        SetResProcessed(0);
        ipc_EXEC_m(m_activeBeas[0]->Recall(););
        SetBeaStatus(0, bs_PROCESSING);
    } catch (ivd_Exception& e){
        log_ERR_m("[" << m_iJobParams.jobID <<
                    "] Catched Exception when calling Bea->Recall " << e);
        switch (e.GetError()){
            case(ie_MEDIUM_MEDERR):
            case(ie_MEDIUM_PROTECTED):
            case(ie_MEDIUM_HWERR):
            case(ie_SCSI_HOST):
                {
                    ReleaseResources();
                    RecallRetry();
                    break;
                }
            default:
                throw;
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void i_RecallJob_i::RecallRetry (  )  [private]
void i_RecallJob_i::ReleaseResources (  )  [private]

Definition at line 278 of file i_recalljob_impl.cpp.

References dbg_LOW, dbg_NORM, i_Job_i::GetResources(), ipc_EXEC_m, i_JobParams::jobID, log_DBG_m, log_ERR_m, log_FUNC_m, i_Job_i::m_iJobParams, i_Job_i::m_rm, and i_Job_i::SetResReleased().

Referenced by MediumOperationComplete(), and Process().

                                    {
    log_FUNC_m(ReleaseResources);
    try {
        ipc_EXEC_m(
            //resource are released because hsm->recall can last long time
            log_DBG_m(dbg_LOW, "[" << m_iJobParams.jobID <<
            "] " << "ReleaseResource for jobId");
            i_ResourceList_t res = GetResources();
            try {
                ipc_EXEC_m(m_rm->ReleaseResource(m_iJobParams, res));
            } catch (ivd_Error &e){
                log_ERR_m("Releasing FAILED for jobID: " <<
                           m_iJobParams.jobID << endl << e)
            }

            for (UInt32_t i = 0 ; i < res.length(); ++i) {
                SetResReleased(i);
            }
        log_DBG_m(dbg_NORM,"[" << m_iJobParams.jobID <<
            "] " << "Resources Released for job");

        );
    } catch (ivd_Exception& e){
        log_ERR_m(
            "[" << m_iJobParams.jobID << "] " <<
            "Catched Exception when calling rm->ReleaseResource" << e);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class pm_RecallClientThread [friend]

Definition at line 78 of file i_recalljob_impl.h.

Referenced by MediumOperationComplete().


Member Data Documentation

Reimplemented from i_Job_i.

Definition at line 122 of file i_recalljob_impl.h.

i_CopiesPos_v_t_var i_RecallJob_i::m_allCopiesPos [private]

Definition at line 111 of file i_recalljob_impl.h.

Referenced by Execute(), and PrepareResource().

Definition at line 115 of file i_recalljob_impl.h.

Referenced by GetNextRecallSet(), and MediumOperationComplete().

Definition at line 97 of file i_recalljob_impl.h.

Referenced by PrepareResource().

Definition at line 120 of file i_recalljob_impl.h.

Referenced by CompleteJob(), and pm_RecallClientThread::Run().

Definition at line 114 of file i_recalljob_impl.h.

Referenced by PrepareResource().

Definition at line 117 of file i_recalljob_impl.h.

Referenced by MediumOperationComplete().


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