Public Member Functions | Private Member Functions | Private Attributes

pm_JobMgr Class Reference
[G_new_group]

#include <pm_jobmanager.h>

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

List of all members.

Public Member Functions

 pm_JobMgr ()
virtual ~pm_JobMgr ()
i_JobID_t Migrate (const pm_FileList &a_files, ivd_MigrationID_t a_migID, UInt64_t a_majColId, UInt64_t a_minColId, UInt32_t a_flags)
 Creates migration Job.
i_JobID_t CreateRecallJob (const i_Recall_t &a_file)
 Creates recall Job.
i_JobID_t CreateEfficientRecallJobs (const i_RecallList_t &a_files, i_JobID_t a_mainJobID)
void EfficientRecallGetLocations (const i_RecallList_t &a_recallList, fsc_FileLocStorage &a_fileLocStorage, i_RecallList_t &a_filesWithNoCopy)
i_Job_iGetRecallJob (const UInt32_t a_mediumKey)
i_JobID_t FSCRecovery (const i_StringList_t &a_volumes, i_UIMessageServer_ptr a_uims)
 Creates FSC recovery Job.
i_JobID_t CreateFSCRecoveryJob (const i_StringList_t &a_volumes, i_UIMessageServer_ptr a_uims)
 Collects info about volumes to be recovered and starts recovery job.
i_JobID_t CreateIVDFSRecoveryJob (i_UIMessageServer_ptr a_uims)
i_JobID_t CheckFSCvsIVDFS (Int32_t a_numFilesPerBatch, Int16_t a_sysLoadPct, i_UIMessageServer_ptr a_uims)
i_JobID_t CreateCheckFSCvsMediaJob (i_MediumSeqByVol_t a_volSeqByMed, bool a_autoCorrect, bool a_removeMissingOnMedia, i_UIMessageServer_ptr a_uims)
i_JobID_t CreateReorgScanJob (const i_Time_t a_date, CORBA::Long a_numOfGenerations, i_UIMessageServer_ptr a_uims)
 Reorg scan interface.
i_JobID_t CreateReorgJob (string a_barcode, vector< UInt32_t > a_volumes, i_UIMessageServer_ptr a_uims)
 Reorg scan interface.
i_JobID_t CreateCopyContentsJob (string a_barcode, const i_VolNumList_t &a_volumes,::CORBA::Boolean a_best_effort, i_UIMessageServer_ptr a_uims)
 CopyContents interface.
i_JobID_t CreateDelExpiredFilesJob (i_UIMessageServer_ptr a_uims)
 Delete Expired Files.
UInt64_t GetNewMigId ()
void SetPMi (i_PartitionManager_i *a_iPMi)
i_PartitionManager_iGetPMi ()

Private Member Functions

void InitParams (i_JobParams &a_params, ivd_JobType_e a_jobType, i_BufType_t a_bufType)
void CreateRecoveryJob (i_Resource_t a_resource, i_VolInfoList_t a_volInfoList, vector< UInt32_t > a_openVolList)
i_JobID_t CreateMigrationJob (const pm_FileList &a_files, UInt64_t a_migId, UInt64_t a_majColId, UInt64_t a_minColId, UInt32_t a_flags)
i_JobID_t CreateMaintJob (i_JobParams a_params, i_Resource_t a_resource, Int32_t a_numFilesPerBatch, Int16_t a_sysLoadPct, i_VolInfoList_t a_volInfoList, vector< UInt32_t > a_openVolList)
i_JobID_t CreateCheckFSCvsMediumJob (i_Resource_t a_resource, i_MediumSeqByVol_t a_volSeqByMed, vector< UInt32_t > a_openVolList, bool a_autoCorrect, bool a_removeMissingOnMedia, i_UIMessageServer_ptr a_uims)

Private Attributes

 log_CLASSID_m
i_PartitionManager_im_iPMi

Detailed Description

Definition at line 40 of file pm_jobmanager.h.


Constructor & Destructor Documentation

pm_JobMgr::pm_JobMgr (  ) 

Definition at line 62 of file pm_jobmgr.cpp.

    : m_iPMi(NULL) {
}

pm_JobMgr::~pm_JobMgr (  )  [virtual]

Definition at line 66 of file pm_jobmgr.cpp.

                     {
}


Member Function Documentation

i_JobID_t pm_JobMgr::CheckFSCvsIVDFS ( Int32_t  a_numFilesPerBatch,
Int16_t  a_sysLoadPct,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 524 of file pm_jobmgr.cpp.

References job_Manager::AddJobToList(), ui_MsgWriter::DisplayWarning(), evt_WARNING, g_cmn, i_Job_i::GetJobId(), GetPMi(), ipc_EXEC_m, log_ERR_m, log_FUNC_m, log_WriteEvent(), m_iPMi, ivd_Product::m_nameShort, and cmn_Global::prod.

Referenced by i_PartitionManager_i::CheckFSCvsIVDFS().

                                                             {
    log_FUNC_m(CheckFSCvsIVDFS);

    string msg;
    // Make sure that the job is not already running.
    try {
        ipc_EXEC_m (
            i_HSM_var iHSM = GetPMi()->GetHSM();
            if (iHSM->IsCheckFSCvsIVDFSRunning()) {
                msg = "HSMFS vs. FSC consistency check already running.";
                log_WriteEvent(evt_WARNING, msg);
                ui_MsgWriter uims(a_uims);
                uims.DisplayWarning(msg);
                return 0;
            }
        );
    }
    catch(ivd_Error) {
        msg = "Can't invoke " + g_cmn.prod.m_nameShort 
            + "-HSM, probably not mounted.";
        log_WriteEvent(evt_WARNING, msg);
        ui_MsgWriter uims(a_uims);
        uims.DisplayWarning(msg);
        return 0;
    };

    try {
        i_FSCCheckJob_i* job;
        job = new i_FSCCheckJob_i(
                        *this, 
                        *m_iPMi,
                        a_uims,
                        a_numFilesPerBatch,
                        a_sysLoadPct);

        AddJobToList(job);
        return job->GetJobId();
    }
    catch (ivd_Exception &ie) {
        log_ERR_m( ie );
        throw;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t pm_JobMgr::CreateCheckFSCvsMediaJob ( i_MediumSeqByVol_t  a_volSeqByMed,
bool  a_autoCorrect,
bool  a_removeMissingOnMedia,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 471 of file pm_jobmgr.cpp.

References job_Manager::AddJobToList(), i_Job_i::GetJobId(), log_ERR_m, log_FUNC_m, and m_iPMi.

Referenced by i_PartitionManager_i::CheckFSCvsMedia(), and i_PartitionManager_i::LimitedCheckFSCvsMedia().

                                                              {
    log_FUNC_m(CreateCheckFSCvsMediaJob);

    try {
        i_MediumCheckJob_i* job = new i_MediumCheckJob_i( 
                                *m_iPMi, 
                                *this, 
                                a_volSeqByMed, 
                                a_autoCorrect,
                                a_removeMissingOnMedia,
                                a_uims);
        
        AddJobToList(job);
        return job->GetJobId();
    }
    catch (ivd_Exception &ie) {
        log_ERR_m( ie );
        throw;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t pm_JobMgr::CreateCheckFSCvsMediumJob ( i_Resource_t  a_resource,
i_MediumSeqByVol_t  a_volSeqByMed,
vector< UInt32_t a_openVolList,
bool  a_autoCorrect,
bool  a_removeMissingOnMedia,
i_UIMessageServer_ptr  a_uims 
) [private]

Definition at line 497 of file pm_jobmgr.cpp.

References job_Manager::AddJobToList(), i_Job_i::GetJobId(), log_ERR_m, log_FUNC_m, and m_iPMi.

                                                        {
    log_FUNC_m(CreateCheckFSCvsMediumJob);

    try {
        i_MediumCheckJob_i* job = new i_MediumCheckJob_i(
                                            *m_iPMi, 
                                            *this,  
                                            a_volSeqByMed,
                                            a_autoCorrect, 
                                            a_removeMissingOnMedia,
                                            a_uims);

        AddJobToList(job);
        return job->GetJobId();
    }
    catch (ivd_Exception &ie) {
        log_ERR_m( ie );
        throw;
    }
}

Here is the call graph for this function:

i_JobID_t pm_JobMgr::CreateCopyContentsJob ( string  a_barcode,
const i_VolNumList_t a_volumes,
::CORBA::Boolean  a_best_effort,
i_UIMessageServer_ptr  a_uims 
)

CopyContents interface.

CopyContentsinterface.

Definition at line 641 of file pm_jobmgr.cpp.

References job_Manager::AddJobToList(), i_Job_i::GetJobId(), log_ERR_m, log_FUNC_m, and m_iPMi.

Referenced by i_PartitionManager_i::CopyContents().

                                                                       {
    log_FUNC_m(CreateCopyContentsJob);
    try {
        i_RedundantCopyJob_i * job;
        job = new i_RedundantCopyJob_i( *this, 
                                        *m_iPMi,
                                        a_barcode,
                                        a_volumes,
                                        a_best_effort,
                                        a_uims);
        AddJobToList(job);
        return job->GetJobId();
    }
    catch (ivd_Exception &ie) {
        log_ERR_m( ie );
        throw;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t pm_JobMgr::CreateDelExpiredFilesJob ( i_UIMessageServer_ptr  a_uims  ) 

Delete Expired Files.

Definition at line 622 of file pm_jobmgr.cpp.

References job_Manager::AddJobToList(), i_Job_i::GetJobId(), log_ERR_m, log_FUNC_m, and m_iPMi.

Referenced by i_PartitionManager_i::TrigDeletion().

                                                                           {
    
    log_FUNC_m(CreateDelExpiredFilesJob);
    try {
        i_DelExpiredFilesJob_i* job;
        job = new i_DelExpiredFilesJob_i(*this, *m_iPMi, a_uims);
        AddJobToList(job);
        return job->GetJobId();
    }
    catch (ivd_Exception &ie) {
        log_ERR_m( ie );
        throw;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t pm_JobMgr::CreateEfficientRecallJobs ( const i_RecallList_t a_files,
i_JobID_t  a_mainJobID 
)

Definition at line 194 of file pm_jobmgr.cpp.

References job_Manager::AddJobToList(), dbg_DETAIL, dbg_NORM, EfficientRecallGetLocations(), i_PartitionManager_i::GetHSM(), fsc_FileLocStorage::GetNextFSLMedium(), i_DISK_BUF, log_DBG_m, log_ERR_m, log_FUNC_m, m_iPMi, and NULL.

Referenced by i_PartitionManager_i::EfficientRecall().

                                                                                                  {
    log_FUNC_m(CreateEfficientRecallJobs);

    try {
        fsc_FileLocStorage fileLocStorage;
        i_RecallList_t     seqFilesWithNoCopy;
        EfficientRecallGetLocations(a_files, 
                                    fileLocStorage, 
                                    seqFilesWithNoCopy);
        
        ivd_MediaKey_t  mediumKey; 

        fsc_FLSPerMedia* filesOnMedium_p 
            = fileLocStorage.GetNextFSLMedium(mediumKey);

        // One list of files for recall in HSM can trigger
        // more jobs in PM. We use the first job ID as the
        // identifier in the HSM.

        log_DBG_m(dbg_NORM, "Job ID " << a_mainJobID << " will be used in HSM as internal index.");

        while (filesOnMedium_p != NULL) {
            log_DBG_m(dbg_DETAIL, "mediumKey" << mediumKey);
            i_EfficientRecallJob_i* job 
                = new i_EfficientRecallJob_i( 
                        *m_iPMi, 
                        *this,
                        mediumKey,
                        filesOnMedium_p,
                        a_mainJobID);

            AddJobToList(job);
            mediumKey = 0;
            filesOnMedium_p = fileLocStorage.GetNextFSLMedium(mediumKey);
        }

        if (seqFilesWithNoCopy.length() > 0) {
            m_iPMi->GetHSM()->EfficientRecall(
                seqFilesWithNoCopy,
                a_mainJobID,
                a_mainJobID,
                0,
                i_DISK_BUF,
                "",
                false,
                i_DownloadAgent::_nil());
        }
    }
    catch (ivd_Exception &ie) {
        log_ERR_m( ie );
        throw;
    }

    return a_mainJobID;
}

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t pm_JobMgr::CreateFSCRecoveryJob ( const i_StringList_t a_volumes,
i_UIMessageServer_ptr  a_uims 
)

Collects info about volumes to be recovered and starts recovery job.

Definition at line 333 of file pm_jobmgr.cpp.

References job_Manager::AddJobToList(), dbg_NORM, evt_WARNING, i_Job_i::GetJobId(), ie_VOL_NOT_FOUND, ivd_Error, log_DBG_m, log_ERR_m, log_FUNC_m, log_WriteEvent(), m_iPMi, i_PartitionManager_i::m_iRM, i_PartitionManager_i::m_partName, and rmdb_MEDVOL_RECOVER.

Referenced by i_PartitionManager_i::FSCRecovery(), and i_PartitionManager_i::i_PartitionManager_i().

                                                                   {

    log_FUNC_m(CreateFSCRecoveryJob);
    
    try {
        i_MediumSeqByVol_t_var allMedVol;
        allMedVol = m_iPMi->m_iRM->SelectAllMediumVolByPart(
                                CORBA::string_dup(m_iPMi->m_partName.c_str()));
        
        log_DBG_m(dbg_NORM,"Found: " << allMedVol->length() << " medium");
        
        //counting media
        if (allMedVol->length() < 1){
            //nothing to recover???
            log_WriteEvent(evt_WARNING, "No media volumes to recover.");
            return 0;
        }

        //check if any volume has recovery flag set
        //if yes, prepare those volumes for job into volSeqByMed 
        
        i_MediumSeqByVol_t volSeqByMed;
        //if ivdrecover -f is run a_volumes is empty
        if (a_volumes.length() == 0) {
            //get list of volumes from rmdb
            volSeqByMed = *(allMedVol._retn());
            i_MediumSeqByVol_t tmpVolSeq;
            
            //if status of volume = recovery prepare it for job into volSeqByMed
            UInt32_t tmpj = 0; //check if medium has changed
            for (UInt32_t j = 0; j < volSeqByMed.length(); j++){
                for (UInt32_t k = 0; k < volSeqByMed[j].length(); k++){
                    if (volSeqByMed[j][k].status & rmdb_MEDVOL_RECOVER){
                        int mediaLength = tmpVolSeq.length();
                        if ((mediaLength == 0) || (tmpj < j)) {
                            tmpVolSeq.length(++mediaLength);
                            tmpj = j; 
                        }                     
                        int volumeLength = tmpVolSeq[mediaLength - 1].length();
                        tmpVolSeq[mediaLength - 1].length(++volumeLength);
                        tmpVolSeq[mediaLength - 1][volumeLength - 1] = volSeqByMed[j][k];
                    }
                }
            }
            if (tmpVolSeq.length() > 0) {
                //some volumes found for recovery, use only those
                volSeqByMed = tmpVolSeq;
            }
        } else {
            i_MediumVolSeq_t tmpVolSeq;

            //recover just specified volumes
            bool found = false;
            tmpVolSeq.length( a_volumes.length() );

            //copy all required volumes to tmpVolSeq
            for (UInt32_t i = 0; i < a_volumes.length(); i++){

                for (UInt32_t j = 0; j < allMedVol->length(); j++){
                    for (UInt32_t k = 0; k < allMedVol[j].length(); k++){
                        if ( strcmp(allMedVol[j][k].medVolId, a_volumes[i] ) == 0 ) {
                            tmpVolSeq[i] = allMedVol[j][k];
                            found = true;
                            break;
                        }
                    }
                }
                if (!found){
                    throw ivd_Error(
                        ie_VOL_NOT_FOUND,
                        "Nonexistent volume was specified for recovery");
                }
                found = false;
            }

            //make new volSeqByMed out of tmpVolSeq

            for (UInt32_t i = 0; i < tmpVolSeq.length(); i++){

                for (UInt32_t j = 0; j < volSeqByMed.length(); j++){ //for each medium
                    if (volSeqByMed[j].length() > 0){ //is there a medium entry
                        if ( strcmp(volSeqByMed[j][0].mediumBarcode, tmpVolSeq[i].mediumBarcode ) == 0 ) { //does the barcode match
                            volSeqByMed[j].length( volSeqByMed[j].length() + 1);
                            volSeqByMed[j][volSeqByMed[j].length() - 1] = tmpVolSeq[i];
                            found = true;
                            break;
                        }
                    }
                }
                if (!found){
                    //insert new medium
                    volSeqByMed.length(volSeqByMed.length() + 1);
                    //set length to 1
                    volSeqByMed[volSeqByMed.length() - 1].length(1);
                    //set first in sequence to vol
                    volSeqByMed[volSeqByMed.length() - 1][0] = tmpVolSeq[i];
                }
                found = false;
            }
        } 
        
        i_RecoveryJob_i* job;
        job = new i_RecoveryJob_i(
                                    *m_iPMi, 
                                    *this,
                                    volSeqByMed,
                                    a_uims);

        AddJobToList( job );
        return job->GetJobId();
    }
    catch (ivd_Exception &ie) {
        log_ERR_m( ie );
        throw;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t pm_JobMgr::CreateIVDFSRecoveryJob ( i_UIMessageServer_ptr  a_uims  ) 

Definition at line 452 of file pm_jobmgr.cpp.

References job_Manager::AddJobToList(), i_Job_i::GetJobId(), log_ERR_m, log_FUNC_m, and m_iPMi.

Referenced by i_PartitionManager_i::IVDFSRecover().

                                                                         {
    log_FUNC_m(CreateIVDFSRecoveryJob);

    try {
        i_RecreatedIVDFSJob_i* job;
        job = new i_RecreatedIVDFSJob_i(
            *this, 
            *m_iPMi,
            a_uims);
        AddJobToList(job);
        return job->GetJobId();
    }
    catch (ivd_Exception &ie) {
        log_ERR_m( ie );
        throw;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t pm_JobMgr::CreateMaintJob ( i_JobParams  a_params,
i_Resource_t  a_resource,
Int32_t  a_numFilesPerBatch,
Int16_t  a_sysLoadPct,
i_VolInfoList_t  a_volInfoList,
vector< UInt32_t a_openVolList 
) [private]
i_JobID_t pm_JobMgr::CreateMigrationJob ( const pm_FileList a_files,
UInt64_t  a_migId,
UInt64_t  a_majColId,
UInt64_t  a_minColId,
UInt32_t  a_flags 
) [private]

Definition at line 131 of file pm_jobmgr.cpp.

References job_Manager::AddJobToList(), dbg_NORM, i_Job_i::GetJobId(), log_DBG_m, log_ERR_m, log_FUNC_m, and m_iPMi.

Referenced by Migrate().

                         {

    log_FUNC_m(CreateMigrationJob);
    log_DBG_m(dbg_NORM, "Started creation of migration job: ");

    try {
        i_MigrationJob_i* job = new i_MigrationJob_i(
            *m_iPMi, 
            *this, 
            a_files, 
            a_migId,
            a_majColId,
            a_minColId,
            a_flags);

        AddJobToList( job );
        return job->GetJobId();
    }
    catch (ivd_Exception &ie) {
        log_ERR_m( ie );
        throw;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t pm_JobMgr::CreateRecallJob ( const i_Recall_t a_file  ) 

Creates recall Job.

Definition at line 165 of file pm_jobmgr.cpp.

References job_Manager::AddJobToList(), i_Job_i::GetJobId(), log_ERR_m, log_FUNC_m, and m_iPMi.

Referenced by i_PartitionManager_i::Recall().

                                                            {
    log_FUNC_m(Recall);

    try {

        //if (!into)
            //split files regarding media
            //prepare list of files that do not have valid copies

        //for each medium 
            //Get job by Medium
            //job is waiting for resources?
                // Append list of files to job
            //else
               //start recall job      


        i_RecallJob_i* job = new i_RecallJob_i( *m_iPMi, 
                                                *this, 
                                                a_file);
        AddJobToList( job );
        return job->GetJobId();
    }
    catch (ivd_Exception &ie) {
        log_ERR_m( ie );
        throw;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pm_JobMgr::CreateRecoveryJob ( i_Resource_t  a_resource,
i_VolInfoList_t  a_volInfoList,
vector< UInt32_t a_openVolList 
) [private]
i_JobID_t pm_JobMgr::CreateReorgJob ( string  a_barcode,
vector< UInt32_t a_volumes,
i_UIMessageServer_ptr  a_uims 
)

Reorg scan interface.

Reorg interface.

Definition at line 594 of file pm_jobmgr.cpp.

References job_Manager::AddJobToList(), dbg_LOW, i_Job_i::GetJobId(), GetNewMigId(), ipc_EXEC_m, log_DBG_m, log_FUNC_m, and m_iPMi.

Referenced by i_PartitionManager_i::Reorg(), and i_PartitionManager_i::ReorgByColId().

                                                          {
    log_FUNC_m(CreateReorgJob);

    ivd_MigrationID_t migID;
    ipc_EXEC_m ( migID = GetNewMigId(); );
    
    try {
        i_ReorgJob_i * job;
        job = new i_ReorgJob_i( *this, 
                                *m_iPMi,
                                a_barcode,
                                a_volumes,
                                migID,
                                a_uims);
        AddJobToList(job);
        return job->GetJobId();
    }
    catch (ivd_Exception &ie) {
        log_DBG_m(dbg_LOW, ie );
        throw;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

i_JobID_t pm_JobMgr::CreateReorgScanJob ( const i_Time_t  a_date,
CORBA::Long  a_numOfGenerations,
i_UIMessageServer_ptr  a_uims 
)

Reorg scan interface.

Definition at line 570 of file pm_jobmgr.cpp.

References job_Manager::AddJobToList(), i_Job_i::GetJobId(), log_ERR_m, log_FUNC_m, and m_iPMi.

Referenced by i_PartitionManager_i::ReorgScan().

                                                                   {
    log_FUNC_m(CreateReorgScanJob);
    
    try {
        i_ReorgScanJob_i * job;
        job = new i_ReorgScanJob_i( *this, 
                                    *m_iPMi,
                                    a_date,
                                    a_numOfGenerations,
                                    a_uims);
        AddJobToList(job);
        return job->GetJobId();
    }
    catch (ivd_Exception &ie) {
        log_ERR_m( ie );
        throw;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pm_JobMgr::EfficientRecallGetLocations ( const i_RecallList_t a_recallList,
fsc_FileLocStorage a_fileLocStorage,
i_RecallList_t a_filesWithNoCopy 
)

Definition at line 250 of file pm_jobmgr.cpp.

References i_MediumPos_t::blockOffset, dbg_DETAIL, i_Recall_t::fileID, i_Recall_t::fileIdx, i_Recall_t::fileSize, i_PartitionManager_i::GetFSC(), fsc_FileLocStorage::Insert(), ipc_EXEC_m, log_DBG_m, log_FUNC_m, m_iPMi, i_PartitionManager_i::m_iRM, max, i_MediumPos_t::mediumKey, i_MediumPos_t::medVolNum, fsc_FileLocStorage::SortList(), and i_MediumPos_t::splitSize.

Referenced by CreateEfficientRecallJobs().

                                                                                         {
    log_FUNC_m(EfficientRecallGetLocations);
    
    CORBA::ULong max = 16;
    a_filesWithNoCopy.length(max);
    unsigned int noCopyIdx = 0;
    
    i_FSC_var fsc = m_iPMi->GetFSC();
    i_ResourceManager_var  rm = m_iPMi->m_iRM;
    try {
        for (unsigned int i = 0; i < a_recallList.length(); ++i) { // for each file
            const i_Recall_t &recInfo = a_recallList[i]; 
            log_DBG_m(dbg_DETAIL, "    #, fileID,   fileSize, jIdx, fIdx");
            log_DBG_m(dbg_DETAIL, setw(5) << i
                               << setw(8) << recInfo.fileID
                               << setw(12) << recInfo.fileSize
                               << setw(6) << recInfo.fileIdx);

            try {
                i_CopiesPos_v_t_var copiesPos;
                ivd_MigrationID_t migID = 0;
                ipc_EXEC_m(
                    copiesPos = fsc->GetCopiesPos(
                                            recInfo.fileID,
                                            migID,
                                            recInfo.fileSize );
                );
                
                UInt32_t bestCopyIdx = 0;
                ipc_EXEC_m(
                    bestCopyIdx = rm->GetBestCopy(copiesPos);
                );
                
                i_MediumPos_v_t &medium_v = copiesPos[bestCopyIdx];

                int splitNo = medium_v.length();
                for (int s = 0; s < splitNo; s++) {
                    i_MediumPos_t   &medPos  = medium_v[s];

                    ivd_FileLocationData_t fld(medPos.blockOffset,
                                            recInfo.fileID,
                                            migID,
                                            medPos.splitSize,
                                            recInfo.fileIdx);
                                               
                    a_fileLocStorage.Insert(medPos.mediumKey,
                                            medPos.medVolNum,
                                            fld);
                    log_DBG_m(dbg_DETAIL, "Inserted for recall; #: " << i
                                        << ", fileID: " << recInfo.fileID
                                        << ", MigID: " << migID
                                        << ", mediumKey: " << medPos.mediumKey
                                        << ", medVolNum: " << medPos.medVolNum
                                        << ", blockOffset: " << medPos.blockOffset);
                 }
            } 
            catch (ivd_Exception) { // no copies or other error.
                if (noCopyIdx >= a_filesWithNoCopy.maximum()) {
                    max *= 2;
                    a_filesWithNoCopy.length(max);
                }
                a_filesWithNoCopy[noCopyIdx] = recInfo;
                ++noCopyIdx;
                log_DBG_m(dbg_DETAIL, "Inserted for return as failed. #: " << noCopyIdx
                                    << ", fileID: " << recInfo.fileID);
            }
        }
        a_filesWithNoCopy.length(noCopyIdx);
        a_fileLocStorage.SortList();
    }
    ipc_CATCH_IVD_THROW_CORBA_m;    
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Creates FSC recovery Job.

UInt64_t pm_JobMgr::GetNewMigId (  ) 

Definition at line 666 of file pm_jobmgr.cpp.

References GetPMi(), ipc_EXEC_m, log_FUNC_m, m_iPMi, and i_PartitionManager_i::m_iRM.

Referenced by CreateReorgJob(), and Migrate().

                                 {

    log_FUNC_m(GetNewMigId);

    ipc_EXEC_m(
        return m_iPMi->m_iRM->GetNewMigId(GetPMi()->m_partName.c_str());
    );

}

Here is the call graph for this function:

Here is the caller graph for this function:

i_PartitionManager_i * pm_JobMgr::GetPMi (  ) 

Definition at line 76 of file pm_jobmgr.cpp.

References log_FUNC_m, and m_iPMi.

Referenced by CheckFSCvsIVDFS(), and GetNewMigId().

                                        {
    log_FUNC_m(GetPMi);

    return m_iPMi;
}

Here is the caller graph for this function:

i_Job_i* pm_JobMgr::GetRecallJob ( const UInt32_t  a_mediumKey  ) 
void pm_JobMgr::InitParams ( i_JobParams a_params,
ivd_JobType_e  a_jobType,
i_BufType_t  a_bufType 
) [private]
i_JobID_t pm_JobMgr::Migrate ( const pm_FileList a_files,
ivd_MigrationID_t  a_migID,
UInt64_t  a_majColId,
UInt64_t  a_minColId,
UInt32_t  a_flags 
)

Creates migration Job.

Migrate creates migration job for each group of files (grouping NYI).

Definition at line 85 of file pm_jobmgr.cpp.

References i_FSC_i::CompleteMigration(), CreateMigrationJob(), dbg_LOW, dbg_NORM, GetNewMigId(), ipc_EXEC_m, log_DBG_m, log_FUNC_m, i_PartitionManager_i::m_config, cfg_PM::m_globalTree, i_PartitionManager_i::m_iFSCi, m_iPMi, and cfg_Tree::pools.

Referenced by i_PartitionManager_i::Migrate().

                                                          {
    log_FUNC_m(Migrate);
    ivd_MigrationID_t migId(a_migID);
//
// CR by Matej Kenda
// Why is it necessary to reuse the migration ID for failed jobs that have been restarted?
// What do we gain with that?
//

    ipc_EXEC_m (
        if (a_migID == 0) {
            log_DBG_m(dbg_NORM, "Requesting new migration ID.");
            migId = GetNewMigId();
            log_DBG_m(dbg_NORM, "Got new migration ID: " << migId);
        }
        else {
            log_DBG_m(dbg_LOW,
                "Migration was restarted. Reset FSC state for this migID.");
            // Inform FSC that the migration is restarted
            // to clean up temporary objects.
            // The operation doesn't fail.
            i_FSC_i* fsc_p = m_iPMi->m_iFSCi;
            fsc_p->CompleteMigration(
                a_migID,
                m_iPMi->m_config.m_globalTree.pools.size() );
        }

        // for each group {

        return CreateMigrationJob(a_files, migId, a_majColId, a_minColId, a_flags);
        //}
    );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pm_JobMgr::SetPMi ( i_PartitionManager_i a_iPMi  ) 

Definition at line 70 of file pm_jobmgr.cpp.

References log_FUNC_m, and m_iPMi.

Referenced by i_PartitionManager_i::i_PartitionManager_i().

                                                   {
    log_FUNC_m(SetPMi);

    m_iPMi = a_iPMi;
}

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from job_Manager.

Definition at line 46 of file pm_jobmanager.h.


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