#include <i_maintfrijob_impl.h>


Definition at line 72 of file i_maintfrijob_impl.h.
Public Member Functions | |
| i_MaintFriJob_i (i_PartitionManager_i &a_iPM, pm_JobMgr &a_jobMgr, i_MediumSeqByVol_t &a_medSeqByVol, i_UIMessageServer_ptr a_uims, const cmn_Path &a_uiMsgWriterFile="", bool a_secondTry=false, bool a_autoCorrect=false, bool removeMissingOnMedia=false) | |
| virtual | ~i_MaintFriJob_i () |
| 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) |
| virtual i_JobRequestList_t * | GetFiles () |
| void | FRIReadSuccess (i_Index_t a_beaNum, i_Index_t a_volNum, i_BlkOffset_t a_lastDataPos) |
| i_FSC_ptr | GetFSC () |
| void | GetFRI (UInt32_t a_medNum) |
| void | RecreateFRI (UInt32_t a_medNum) |
| void | Process (Int32_t a_medNum) |
| Non-interface function. | |
| virtual void | ProcessFRI (pm_FRIInfo a_FRIInfo)=0 |
| virtual void | Execute ()=0 |
| void | PrepareMedium (i_MediumSeqByVol_t &a_medSeqByVol, bool a_autoCorrect, bool a_removeMissingOnMedia) |
| void | PrepareVolumes (i_MediumVolSeq_t &a_medVolSeq, MediumInfo_t &a_medInfo) |
| void | CheckReadFri (UInt32_t a_beaNum) |
| void | RequestResources () |
| void | ReleaseResources (UInt32_t a_medNum) |
| bool | AllBeaFinished () |
| void | AbortFriProcessor () |
| void | InsertToFriProcessor (pm_FRIInfo a_friInfo) |
| void | EndOfFRIInput () |
Public Attributes | |
| bool | m_allFriSuccess |
| bool | m_allFriRead |
| pm_FriProcessor * | m_friProcessor |
| cmn_Mutex | m_friProcessor_x |
| ui_MsgWriter | m_uiMsgWriter |
| log_CLASSID_m | |
Protected Attributes | |
| i_PartitionManager_i & | m_iPM |
| vector< MediumInfo_t > | m_mediumInfoVec |
| cmn_ThreadCounter | m_threadCnt |
Friends | |
| class | pm_AssignResThread |
| i_MaintFriJob_i::i_MaintFriJob_i | ( | i_PartitionManager_i & | a_iPM, | |
| pm_JobMgr & | a_jobMgr, | |||
| i_MediumSeqByVol_t & | a_medSeqByVol, | |||
| i_UIMessageServer_ptr | a_uims, | |||
| const cmn_Path & | a_uiMsgWriterFile = "", |
|||
| bool | a_secondTry = false, |
|||
| bool | a_autoCorrect = false, |
|||
| bool | removeMissingOnMedia = false | |||
| ) |
Definition at line 38 of file i_maintfrijob_impl.cpp.
References i_JobParams::bufType, i_JobParams::copies, rm_String::cvalue_p, dbg_DETAIL, dbg_NORM, ui_MsgWriter::DisplayMessage(), i_Job_i::GetResources(), i_DISK_BUF, i_Job_i::InitBeaStatus(), i_JobParams::jobID, i_JobParams::jobType, jt_MAINT, log_DBG_m, log_FUNC_m, ipc_Log::LogMediumVol(), i_Job_i::m_activeBeas, i_PartitionManager_i::m_config, m_friProcessor, i_Job_i::m_iJobParams, m_iPM, i_PartitionManager_i::m_rmPart, m_threadCnt, m_uiMsgWriter, cfg_PMCfg::name, rm_Partition::partitionUUIDString, i_JobParams::partName, i_JobParams::partUUID, PrepareMedium(), and cmn_Thread::Start().
00047 : i_Job_i(a_jobMgr), 00048 m_allFriSuccess(true), 00049 m_iPM(a_iPM), 00050 m_allFriRead(false), 00051 m_uiMsgWriter(a_uiMsgWriterFile, a_uims) 00052 { 00053 log_FUNC_m(i_MaintFriJob_i); 00054 00055 //log all media and volumes 00056 log_DBG_m(dbg_DETAIL,"Media for FRI:" << a_medSeqByVol.length() ); 00057 for (UInt32_t i = 0; i < a_medSeqByVol.length(); i++){ 00058 for (UInt32_t j = 0; j < a_medSeqByVol[i].length(); j++){ 00059 log_DBG_m(dbg_NORM,"Will recover volume:" << endl 00060 << ipc_Log::LogMediumVol(a_medSeqByVol[i][j]) << endl); 00061 } 00062 } 00063 00064 00065 m_iJobParams.jobType = jt_MAINT; 00066 m_iJobParams.partName = 00067 CORBA::string_dup(m_iPM.m_config.name.c_str()); 00068 00069 m_iJobParams.partUUID = 00070 CORBA::string_dup(m_iPM.m_rmPart.partitionUUIDString.cvalue_p); 00071 00072 m_iJobParams.bufType = i_DISK_BUF; 00073 m_iJobParams.copies = 0; 00074 00075 00076 ostringstream msg; 00077 msg << "Started (JobID: " << m_iJobParams.jobID << ")."; 00078 m_uiMsgWriter.DisplayMessage(msg.str()); 00079 00080 PrepareMedium(a_medSeqByVol, a_autoCorrect, a_removeMissingOnMedia); 00081 00082 UInt32_t numOfBeas((GetResources()).length()); 00083 00084 m_activeBeas.resize(numOfBeas); 00085 InitBeaStatus(numOfBeas); 00086 00087 m_friProcessor = new pm_FriProcessor(this, m_threadCnt); 00088 m_friProcessor->Start(); 00089 00090 }

| i_MaintFriJob_i::~i_MaintFriJob_i | ( | ) | [virtual] |
Definition at line 93 of file i_maintfrijob_impl.cpp.
References dbg_LOW, ui_MsgWriter::DisplayError(), ui_MsgWriter::DisplayMessage(), i_Job_i::GetJobTypeText(), i_JobParams::jobID, log_DBG_m, log_ERR_m, log_FUNC_m, log_WriteEvent(), i_Job_i::m_iJobParams, m_mediumInfoVec, friVolStatus_t::m_processed, friVolStatus_t::m_read, friVolStatus_t::m_recreated, m_uiMsgWriter, friVolStatus_t::m_volInfo, i_VolInfo_t::medVolID, and i_VolInfo_t::volNum.
00093 { 00094 log_FUNC_m(~i_MaintFriJob_i); 00095 00096 //summary which fri were processed. 00097 00098 bool allProcessed(true); 00099 00100 for (UInt32_t i(0); i < m_mediumInfoVec.size(); i++){ 00101 log_DBG_m(dbg_LOW, "i:" << i << 00102 " barcode:" << m_mediumInfoVec[i].m_medium.barcode); 00103 for (UInt32_t j(0); j < m_mediumInfoVec[i].m_friVolStatus.size(); j++){ 00104 friVolStatus_t &fri = m_mediumInfoVec[i].m_friVolStatus[j]; 00105 00106 log_DBG_m(dbg_LOW, "FRI for volume " << fri.m_volInfo.medVolID << 00107 " processed:" << fri.m_processed << 00108 " read:" << fri.m_read << 00109 " recreated:" << fri.m_recreated); 00110 00111 if (!fri.m_processed) { 00112 allProcessed = false; 00113 ostringstream errMsg; 00114 errMsg << "Processing of FRI file for Volume: " 00115 << fri.m_volInfo.medVolID << " failed. " << 00116 " Barcode: " << m_mediumInfoVec[i].m_medium.barcode << 00117 " VolNr.: " << fri.m_volInfo.volNum << 00118 " See error log file for details." 00119 << endl; 00120 m_uiMsgWriter.DisplayError(errMsg.str()); 00121 log_WriteEvent(errMsg.str(), GetJobTypeText(), m_iJobParams.jobID); 00122 00123 if (fri.m_read){ 00124 log_ERR_m(errMsg.str() << " Reading from medium succeeded."); 00125 } else { 00126 log_ERR_m(errMsg.str() << " Reading from medium failed."); 00127 } 00128 } 00129 } 00130 } 00131 00132 ostringstream msg; 00133 msg << "Finished (JobID: " << m_iJobParams.jobID << ")."; 00134 m_uiMsgWriter.DisplayMessage(msg.str()); 00135 }

| void i_MaintFriJob_i::GetNewResources | ( | i_Index_t | a_resNum | ) | [virtual] |
Implements i_Job_i.
Definition at line 645 of file i_maintfrijob_impl.cpp.
References i_Job_i::GetResources(), ie_IMPOSSIBLE, ipc_CATCH_IVD_THROW_CORBA_m, and log_FUNC_A_m.
00645 { 00646 log_FUNC_A_m(GetResources, "resNum=" << a_resNum); 00647 try { 00648 throw ivd_InternalError(ie_IMPOSSIBLE); 00649 } ipc_CATCH_IVD_THROW_CORBA_m; 00650 }

| void i_MaintFriJob_i::MediumOperationComplete | ( | i_Index_t | a_beaNum, | |
| i_CompletionStatus_e | a_status | |||
| ) | [virtual] |
Implements i_Job_i.
Definition at line 423 of file i_maintfrijob_impl.cpp.
References AllBeaFinished(), cmn_Condition::Broadcast(), bs_NOT_RUNNING, bs_RUNNING, CheckReadFri(), dbg_DETAIL, dbg_NORM, ui_MsgWriter::DisplayMessage(), EndOfFRIInput(), i_Job_i::GetJobTypeText(), i_Job_i::GetResources(), i_SUCCEDED, i_UNKNOWN, ie_FATAL_ERROR, ipc_CATCH_IVD_THROW_CORBA_m, ipc_EXEC_m, ipc_ObjectExists(), i_Job_i::IsAborted(), job_POST_MED_PROC, i_JobParams::jobID, log_DBG_m, log_FUNC_m, log_WriteEvent(), ipc_Log::LogResources(), ipc_Log::LogStatus(), i_Job_i::m_activate_c, i_Job_i::m_activate_x, i_Job_i::m_activeBeas, MediumInfo_t::m_allFriRead, m_allFriSuccess, MediumInfo_t::m_beaFinished, i_Job_i::m_beasStatus_x, i_Job_i::m_iJobParams, m_mediumInfoVec, MediumInfo_t::m_secondTry, i_Job_i::m_status, m_uiMsgWriter, RecreateFRI(), ReleaseResources(), i_Resource_t::resAllocated, i_Job_i::ResetResMedOpComplete(), i_Resource_t::resReleased, i_Job_i::SetBeaStatus(), i_Job_i::SetResMedOpComplete(), and i_Job_i::SetStatus().
Referenced by GetFRI(), and Process().
00425 { 00426 00427 log_FUNC_m(MediumOperationComplete); 00428 00429 log_DBG_m(dbg_NORM, "Recovery Completed by" << 00430 a_beaNum << " status: [" << a_status << "]" << 00431 ipc_Log::LogStatus(a_status) << endl << 00432 m_iJobParams.jobID); 00433 00434 if (IsAborted()){ 00435 return; 00436 } 00437 00438 try { 00439 if (a_beaNum > static_cast<i_Index_t>(GetResources().length()) ) { 00440 throw ivd_InternalError( 00441 ie_FATAL_ERROR, "Non existing Bea wants to Complete Job??"); 00442 }; 00443 } ipc_CATCH_IVD_THROW_CORBA_m; 00444 00445 SetResMedOpComplete(a_beaNum); 00446 { 00447 cmn_MutexLock l(m_beasStatus_x); 00448 SetBeaStatus(a_beaNum, bs_RUNNING); 00449 } 00450 00451 if (a_status != i_SUCCEDED) { 00452 m_status = a_status; 00453 MediumInfo_t &medInfo = m_mediumInfoVec[a_beaNum]; 00454 medInfo.m_beaFinished = true; 00455 m_allFriSuccess = false; 00456 00457 i_Resource_t res = GetResources()[a_beaNum]; 00458 if (res.resAllocated && !res.resReleased) { 00459 log_DBG_m(dbg_DETAIL, "" << ipc_Log::LogResources(res)); 00460 ReleaseResources(a_beaNum); 00461 log_DBG_m(dbg_NORM, "Shutting down Bea..."); 00462 00463 // If error occured before BEA is started then m_activeBeas = null 00464 { 00465 cmn_MutexLock l(m_beasStatus_x); 00466 SetBeaStatus(a_beaNum, bs_NOT_RUNNING); 00467 } 00468 ipc_EXEC_m( 00469 if (ipc_ObjectExists(m_activeBeas[a_beaNum])) { 00470 m_activeBeas[a_beaNum]->Remove(); 00471 } 00472 else { 00473 log_DBG_m(dbg_NORM, "Bea not running. Skip m_activeBeas[a_beaNum]->Remove()"); 00474 } 00475 ); 00476 } 00477 00478 log_DBG_m(dbg_NORM, "Could not Get/Recreate all FRIs."); 00479 00480 // Check if all beas finished 00481 if ( AllBeaFinished() ) { 00482 EndOfFRIInput(); 00483 SetStatus(job_POST_MED_PROC); 00484 } 00485 else { 00486 log_DBG_m(dbg_DETAIL, "Locking m_activate_x "); 00487 cmn_MutexLock l(m_activate_x); 00488 m_activate_c.Broadcast(); 00489 } 00490 return; 00491 } 00492 00493 //Check which fri's were read 00494 CheckReadFri(a_beaNum); 00495 00496 MediumInfo_t &medInfo = m_mediumInfoVec[a_beaNum]; 00497 bool allFriRead = medInfo.m_allFriRead; 00498 00499 if ( (allFriRead) || (medInfo.m_secondTry) ) { 00500 // if all FRI Read OR already tried recreate 00501 medInfo.m_beaFinished = true; 00502 i_Resource_t res = GetResources()[a_beaNum]; 00503 if (res.resAllocated && !res.resReleased) { 00504 log_DBG_m(dbg_DETAIL, "" << ipc_Log::LogResources(res)); 00505 ReleaseResources(a_beaNum); 00506 log_DBG_m(dbg_DETAIL,"Shutting down Bea"); 00507 { 00508 cmn_MutexLock l(m_beasStatus_x); 00509 SetBeaStatus(a_beaNum, bs_NOT_RUNNING); 00510 m_activeBeas[a_beaNum]->Remove(); 00511 } 00512 } 00513 00514 if (!allFriRead) { 00515 // log_EVT; 00516 ostringstream msg; 00517 msg << "Could not Get/Recreate all FRI's."; 00518 m_uiMsgWriter.DisplayMessage(msg.str()); 00519 log_WriteEvent(msg.str(), GetJobTypeText(), m_iJobParams.jobID); 00520 m_allFriSuccess = false; 00521 } 00522 } 00523 else { 00524 //invoke bea->Recreate from mediumVolume 00525 medInfo.m_secondTry = true; 00526 ResetResMedOpComplete(a_beaNum); 00527 RecreateFRI(a_beaNum); 00528 } 00529 00530 //Check if all beas finished 00531 if ( AllBeaFinished() ) { 00532 if (m_status == i_UNKNOWN){ //nobody set status to failed 00533 m_status = i_SUCCEDED; 00534 }; 00535 EndOfFRIInput(); 00536 SetStatus(job_POST_MED_PROC); 00537 } 00538 }


| void i_MaintFriJob_i::CompleteJob | ( | i_CompletionStatus_e | a_status | ) | [virtual] |
Implements i_Job_i.
Reimplemented in i_MediumCheckJob_i.
Definition at line 559 of file i_maintfrijob_impl.cpp.
References AbortFriProcessor(), dbg_DETAIL, dbg_LOW, ui_MsgWriter::DisplayError(), ui_MsgWriter::DisplayWarning(), evt_ERROR, evt_WARNING, i_Job_i::GetJobTypeText(), i_Job_i::GetResources(), i_BEA_ERROR, i_CLIENT_ERROR, i_CLIENT_NOFILES, i_DATA_ERROR, i_FAILED, i_HW_ERROR, i_LA_ERROR, i_NO_HOST, i_RESOURCE_ERROR, i_SUCCEDED, i_SVC_ERROR, ipc_EXEC_m, i_Job_i::IsAborted(), i_JobParams::jobID, log_DBG_m, log_ERR_m, log_FUNC_m, log_WriteEvent(), ipc_Log::LogResources(), i_Job_i::m_aborted, i_Job_i::m_iJobParams, i_Job_i::m_rm, i_Job_i::m_status, m_threadCnt, m_uiMsgWriter, ReleaseResources(), i_Job_i::Remove(), and cmn_ThreadCounter::WaitAllEnd().
Referenced by i_MediumCheckJob_i::CompleteJob(), and pm_FriProcessor::~pm_FriProcessor().
00559 { 00560 log_FUNC_m(CompleteJob); 00561 00562 //wait for pm_FRIProcessor to finish 00563 if ((IsAborted() || (m_status != i_SUCCEDED))){ 00564 AbortFriProcessor(); 00565 } 00566 00567 log_DBG_m(dbg_LOW,"Waiting for thread to finish"); 00568 m_threadCnt.WaitAllEnd(); 00569 log_DBG_m(dbg_LOW,"thread finished"); 00570 00571 try { 00572 if (a_status == i_SUCCEDED) { 00573 log_WriteEvent("Finished.", GetJobTypeText(), m_iJobParams.jobID); 00574 } 00575 else if (m_aborted) { 00576 log_WriteEvent(evt_WARNING, "Aborted.", 00577 GetJobTypeText(), m_iJobParams.jobID); 00578 m_uiMsgWriter.DisplayWarning("Aborted."); 00579 00580 } 00581 else { 00582 ostringstream os; 00583 os << "Failed (" << a_status << ")."; 00584 log_WriteEvent(evt_ERROR, os.str(), 00585 GetJobTypeText(), m_iJobParams.jobID); 00586 m_uiMsgWriter.DisplayError(os.str()); 00587 00588 switch (a_status) { 00589 case(i_DATA_ERROR): 00590 case(i_HW_ERROR): 00591 //case(i_MEDIUM_ERROR): 00592 00593 break; 00594 00595 case(i_CLIENT_ERROR): //if client failed just remove job 00596 case(i_CLIENT_NOFILES): //if client has no files for Recovery 00597 case(i_LA_ERROR): 00598 case(i_SVC_ERROR): 00599 case(i_NO_HOST): //if LA, SVC or NOHOST ERROR Release resources 00600 00601 case(i_BEA_ERROR): 00602 case(i_RESOURCE_ERROR): 00603 case(i_FAILED): 00604 default: 00605 log_ERR_m( "Job failed."); 00606 } 00607 } 00608 i_ResourceList_t resources = GetResources(); 00609 bool resCanceled(false); 00610 for (UInt32_t i = 0; i < resources.length(); ++i){ 00611 if (resources[i].resAllocated && !resources[i].resReleased) { 00612 try { 00613 log_DBG_m(dbg_DETAIL, "" << ipc_Log::LogResources(resources[i])); 00614 ReleaseResources(i); 00615 } 00616 catch (ivd_Exception& e){ 00617 log_ERR_m("Failed releasing resources." << endl << e); 00618 } 00619 } 00620 00621 if (!resCanceled && resources[i].resRequested && !resources[i].resReleased) { 00622 resCanceled = true; 00623 try { 00624 ipc_EXEC_m( 00625 m_rm->CancelGetResource(m_iJobParams.jobID); 00626 ) 00627 } 00628 catch (ivd_Exception& e) { 00629 log_DBG_m(dbg_LOW, e); 00630 } 00631 } 00632 } 00633 Remove(); 00634 00635 } catch (ivd_Exception& e) { 00636 log_ERR_m(e); 00637 } catch (ivd_InternalError& ie) { 00638 log_ERR_m(ie); 00639 } catch (...) { 00640 log_ERR_m("Caught unknown" ); 00641 } 00642 }


| i_JobRequestList_t * i_MaintFriJob_i::GetFiles | ( | ) | [virtual] |
Implements i_Job_i.
Definition at line 652 of file i_maintfrijob_impl.cpp.
References ie_IMPOSSIBLE, ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and NULL.
00652 { 00653 log_FUNC_m(GetFiles); 00654 try { 00655 throw ivd_InternalError(ie_IMPOSSIBLE); 00656 } ipc_CATCH_IVD_THROW_CORBA_m; 00657 return NULL; 00658 }
| void i_MaintFriJob_i::FRIReadSuccess | ( | i_Index_t | a_beaNum, | |
| i_Index_t | a_volNum, | |||
| i_BlkOffset_t | a_lastDataPos | |||
| ) | [virtual] |
Reimplemented from i_Job_i.
Definition at line 661 of file i_maintfrijob_impl.cpp.
References i_Job_i::GetResources(), ie_FATAL_ERROR, InsertToFriProcessor(), ipc_CATCH_IVD_THROW_CORBA_m, i_Job_i::IsAborted(), ivd_Error, log_FUNC_A_m, and m_mediumInfoVec.
00663 { 00664 log_FUNC_A_m(FRIReadSuccess, "a_beaNum=" << a_beaNum << 00665 ", a_volNum=" << a_volNum << 00666 ", a_lastDataPos" << a_lastDataPos); 00667 00668 00669 if (IsAborted()){ 00670 return; 00671 } 00672 00673 00674 try { 00675 if (a_beaNum > static_cast<i_Index_t>(GetResources().length()) ) { 00676 throw ivd_InternalError( 00677 ie_FATAL_ERROR, "Non existing Bea sent FRIReadSuccess"); 00678 }; 00679 00680 if (m_mediumInfoVec.size() <= static_cast<UInt32_t>(a_beaNum)){ 00681 throw ivd_InternalError(ie_FATAL_ERROR, "Medium does not exist."); 00682 } 00683 00684 bool found(false); 00685 for (UInt32_t i(0); i < m_mediumInfoVec[a_beaNum].m_friVolStatus.size(); i++){ 00686 if (m_mediumInfoVec[a_beaNum].m_friVolStatus[i].m_volInfo.volNum == a_volNum ){ 00687 found = true; 00688 m_mediumInfoVec[a_beaNum].m_friVolStatus[i].m_read = true; 00689 } 00690 } 00691 if (!found){ 00692 throw ivd_Error(ie_FATAL_ERROR, "Medium Volume does not exist."); 00693 } 00694 00695 00696 pm_FRIInfo friInfo(a_beaNum, a_volNum, a_lastDataPos); 00697 InsertToFriProcessor(friInfo); 00698 00699 } ipc_CATCH_IVD_THROW_CORBA_m; 00700 }

| i_FSC_ptr i_MaintFriJob_i::GetFSC | ( | ) | [virtual] |
Implements i_Job_i.
Definition at line 830 of file i_maintfrijob_impl.cpp.
References ie_IMPOSSIBLE, ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and NULL.
00830 { 00831 log_FUNC_m(GetFSC); 00832 try { 00833 throw ivd_InternalError(ie_IMPOSSIBLE); 00834 } ipc_CATCH_IVD_THROW_CORBA_m; 00835 return NULL; 00836 }
| void i_MaintFriJob_i::GetFRI | ( | UInt32_t | a_medNum | ) |
Definition at line 741 of file i_maintfrijob_impl.cpp.
References cmn_CreatePath(), dbg_DETAIL, dbg_NORM, cmn_Global::dirs, g_cmn, i_SUCCEDED, ipc_EXEC_m, log_DBG_m, log_FUNC_m, i_Job_i::m_activeBeas, MediumInfo_t::m_friVolStatus, m_mediumInfoVec, friVolStatus_t::m_read, friVolStatus_t::m_volInfo, MediumOperationComplete(), and ivd_Directories::tmp.
Referenced by Process().
00741 { 00742 log_FUNC_m(GetFRI); 00743 00744 cmn_Path tmpFriPath = g_cmn.dirs.tmp + string("fri"); 00745 cmn_CreatePath(tmpFriPath); 00746 00747 MediumInfo_t &medInfo = m_mediumInfoVec[a_medNum]; 00748 00749 i_VolInfoList_t volToRead; 00750 00751 for (UInt32_t i(0); i < medInfo.m_friVolStatus.size(); i++){ 00752 friVolStatus_t & friVolStatus = medInfo.m_friVolStatus[i]; 00753 00754 if (!friVolStatus.m_read) { 00755 //insert for Read; 00756 log_DBG_m(dbg_DETAIL,"Inserting to list for BEA"); 00757 00758 volToRead.length(volToRead.length() + 1); 00759 volToRead[volToRead.length()-1] = friVolStatus.m_volInfo; 00760 } 00761 } 00762 log_DBG_m(dbg_NORM,"List for recovery length:" << volToRead.length()); 00763 if (volToRead.length() > 0) { 00764 ipc_EXEC_m( 00765 m_activeBeas[a_medNum]->ReadFastRecoveryInfo( 00766 volToRead, 00767 volToRead[0].sysVolNum ); 00768 ); 00769 } else { 00770 MediumOperationComplete(a_medNum, i_SUCCEDED); 00771 } 00772 }


| void i_MaintFriJob_i::RecreateFRI | ( | UInt32_t | a_medNum | ) |
Definition at line 774 of file i_maintfrijob_impl.cpp.
References bs_PROCESSING, dbg_DETAIL, dbg_LOW, dbg_NORM, i_SV_NOTHING, ipc_EXEC_m, ipc_nilStr, i_Job_i::IsAborted(), log_DBG_m, log_FUNC_m, i_Job_i::m_activeBeas, i_Job_i::m_beasStatus_x, MediumInfo_t::m_friVolStatus, m_mediumInfoVec, friVolStatus_t::m_open, friVolStatus_t::m_read, friVolStatus_t::m_recreated, friVolStatus_t::m_volInfo, i_VolInfo_t::medVolID, and i_Job_i::SetBeaStatus().
Referenced by MediumOperationComplete().
00774 { 00775 log_FUNC_m(RecreateFRI); 00776 00777 if (IsAborted()) 00778 return; 00779 //Generate FRI from MedVol 00780 MediumInfo_t &medInfo = m_mediumInfoVec[a_medNum]; 00781 00782 i_VolInfoList_t volList; 00783 i_BoolList_t openVolList; 00784 00785 for (UInt32_t i(0); i < medInfo.m_friVolStatus.size(); i++){ 00786 00787 friVolStatus_t & friVolStatus = medInfo.m_friVolStatus[i]; 00788 try { 00789 log_DBG_m(dbg_LOW,"Generate FRI from MedVol"); 00790 00791 if (!friVolStatus.m_read){ 00792 log_DBG_m(dbg_DETAIL,"i=" << i); 00793 log_DBG_m(dbg_NORM, "Adding Volume for recreation :" << 00794 friVolStatus.m_volInfo.medVolID << 00795 " open: " << friVolStatus.m_open); 00796 00797 volList.length(volList.length() + 1); 00798 volList[volList.length() - 1] = friVolStatus.m_volInfo; 00799 00800 openVolList.length(openVolList.length() + 1); 00801 openVolList[openVolList.length() - 1] = friVolStatus.m_open; 00802 00803 friVolStatus.m_recreated = true; 00804 } 00805 } 00806 catch (ivd_Exception& e){ 00807 log_DBG_m(dbg_DETAIL, " " << e); 00808 } 00809 00810 } 00811 log_DBG_m(dbg_LOW,"Calling Bea for fri recreation"); 00812 00813 { 00814 cmn_MutexLock l(m_beasStatus_x); 00815 ipc_EXEC_m( 00816 m_activeBeas[a_medNum]->RecreateFastRecoveryInfo(volList, 00817 true, 00818 openVolList, 00819 i_SV_NOTHING, 00820 false, 00821 ipc_nilStr); 00822 ); 00823 SetBeaStatus(a_medNum, bs_PROCESSING); 00824 } 00825 }


| void i_MaintFriJob_i::Process | ( | Int32_t | a_medNum | ) |
Non-interface function.
Definition at line 706 of file i_maintfrijob_impl.cpp.
References i_Job_i::ActivateBea(), bs_PROCESSING, bs_RUNNING, ui_MsgWriter::DisplayMessage(), evt_ERROR, GetFRI(), ivd_BaseException::GetFriendly(), i_Job_i::GetJobTypeText(), i_Job_i::GetResources(), i_FAILED, i_Job_i::IsAborted(), i_JobParams::jobID, i_Job_i::LoadUnload(), log_ERR_m, log_FUNC_m, log_WriteEvent(), i_Job_i::m_beasStatus_x, i_Job_i::m_iJobParams, m_uiMsgWriter, MediumOperationComplete(), and i_Job_i::SetBeaStatus().
Referenced by Execute().
00706 { 00707 log_FUNC_m(Process); 00708 00709 if (IsAborted()) 00710 return; 00711 try { 00712 LoadUnload(a_medNum); 00713 cmn_MutexLock l(m_beasStatus_x); 00714 ActivateBea(a_medNum); 00715 SetBeaStatus(a_medNum, bs_RUNNING); 00716 00717 ostringstream msg; 00718 msg << "Reading FRI from medium: " << 00719 GetResources()[a_medNum].barcode << "."; 00720 m_uiMsgWriter.DisplayMessage(msg.str()); 00721 00722 if (IsAborted()) 00723 return; 00724 GetFRI(a_medNum); 00725 SetBeaStatus(a_medNum, bs_PROCESSING); 00726 00727 } catch (ivd_Exception& e){ 00728 00729 log_ERR_m( "[" << m_iJobParams.jobID << "] " << 00730 "Caught Exception when calling BEA: " << e); 00731 ostringstream os; 00732 os << "Failed, BEA error (" << e.GetFriendly() << ")."; 00733 log_WriteEvent(evt_ERROR, os.str(), 00734 GetJobTypeText(), m_iJobParams.jobID); 00735 m_uiMsgWriter.DisplayMessage(os.str()); 00736 00737 MediumOperationComplete(a_medNum, i_FAILED); 00738 } 00739 }


| virtual void i_MaintFriJob_i::ProcessFRI | ( | pm_FRIInfo | a_FRIInfo | ) | [pure virtual] |
Implemented in i_MediumCheckJob_i, and i_RecoveryJob_i.
Referenced by pm_FriProcessor::Run().

| void i_MaintFriJob_i::Execute | ( | ) | [pure virtual] |
Implements i_Job_i.
Implemented in i_MediumCheckJob_i, and i_RecoveryJob_i.
Definition at line 920 of file i_maintfrijob_impl.cpp.
References dbg_DETAIL, dbg_NORM, i_Job_i::GetResources(), i_FAILED, i_RESOURCE_ERROR, i_SUCCEDED, i_Job_i::IsAborted(), i_Job_i::IsFinished(), i_JobParams::jobID, log_DBG_m, log_ERR_m, log_FUNC_m, i_Job_i::m_activate_x, i_Job_i::m_iJobParams, i_Job_i::m_status, i_Job_i::NeedsProcess(), Process(), RequestResources(), i_Job_i::SetResProcessed(), and i_Job_i::WaitBeasToFinish().
Referenced by i_RecoveryJob_i::Execute(), and i_MediumCheckJob_i::Execute().
00920 { 00921 log_FUNC_m(Execute); 00922 00923 try { 00924 RequestResources(); 00925 } catch (ivd_Exception){ 00926 log_DBG_m(dbg_NORM, "RM->GetResources failed. Complete job."); 00927 m_status = i_RESOURCE_ERROR; 00928 throw; 00929 } 00930 try { 00931 while ( !IsFinished() && !IsAborted() ) { 00932 for (UInt32_t i(0); i < GetResources().length(); i++){ 00933 log_DBG_m(dbg_DETAIL, 00934 "[" << m_iJobParams.jobID << 00935 "] " << "Processing copyNum:" << i << 00936 " resources assigned:" << 00937 GetResources()[i].resAssigned << 00938 " copy processed:" << 00939 GetResources()[i].resProcessed); 00940 00941 if (IsAborted()) 00942 return; 00943 00944 if ( NeedsProcess(i)) { 00945 Process(i); 00946 SetResProcessed(i); 00947 i = 0; //restart processing since prev resource may got resources 00948 } 00949 } 00950 00951 bool gotRes(false); 00952 00953 for (UInt32_t i(0); i < GetResources().length(); i++){ 00954 if ( NeedsProcess(i) ) { 00955 gotRes = true; 00956 } 00957 } 00958 00959 cmn_MutexLock l(m_activate_x); 00960 00961 if (!gotRes){ 00962 WaitBeasToFinish(5); 00963 } 00964 } 00965 00966 } catch (ivd_Exception& e) { 00967 log_ERR_m( e ); 00968 00969 m_status = i_FAILED; 00970 throw; 00971 } 00972 m_status = i_SUCCEDED; 00973 00974 }


| void i_MaintFriJob_i::PrepareMedium | ( | i_MediumSeqByVol_t & | a_medSeqByVol, | |
| bool | a_autoCorrect, | |||
| bool | a_removeMissingOnMedia | |||
| ) |
Definition at line 137 of file i_maintfrijob_impl.cpp.
References i_Resource_t::barcode, i_Resource_t::blockSize, dbg_DETAIL, dbg_NORM, ui_MsgWriter::DisplayWarning(), evt_WARNING, i_Job_i::GetJobTypeText(), ie_SELECT_ERROR, ipc_EXEC_m, ivd_Error, i_JobParams::jobID, log_DBG_m, log_FUNC_m, log_WriteEvent(), ipc_Log::LogMedium(), ipc_Log::LogResources(), ipc_Log::LogVolInfo(), i_Job_i::m_iJobParams, m_mediumInfoVec, i_Job_i::m_rm, m_uiMsgWriter, i_Resource_t::mediumKey, PrepareVolumes(), i_Resource_t::resNum, ipc_Init::ResourceInit(), rmdb_MEDIUM_UNRELIABLE, rmdb_MEDIUM_UNUSABLE, and i_Job_i::SetResources().
Referenced by i_MaintFriJob_i().
00138 { 00139 log_FUNC_m(PrepareMedium); 00140 00141 i_ResourceList_t resList; 00142 00143 for (UInt32_t i(0); i < a_medSeqByVol.length(); i++) { 00144 00145 i_MediumVolSeq_t &med = a_medSeqByVol[i]; 00146 i_Medium_t_var medium; 00147 00148 if (med.length() == 0) { 00149 throw ivd_Error(ie_SELECT_ERROR, "Bad i_MediumSeqByVol_t. " 00150 "Medium with no volumes "); 00151 } 00152 ipc_EXEC_m( 00153 medium = m_rm->SelectMedium(med[0].mediumBarcode); 00154 ) 00155 00156 MediumInfo_t medInfo; 00157 medInfo.m_medium = medium; 00158 log_DBG_m (dbg_DETAIL, "" << ipc_Log::LogMedium(medInfo.m_medium)); 00159 PrepareVolumes(med, medInfo); 00160 00161 if (!medInfo.m_friVolStatus.empty()) { 00162 00163 //log everything 00164 ostringstream msg; 00165 msg << ipc_Log::LogMedium(medInfo.m_medium) << endl; 00166 for (UInt32_t i(0); i < medInfo.m_friVolStatus.size(); i++){ 00167 msg << "Volume: " << i << endl; 00168 msg << ipc_Log::LogVolInfo(medInfo.m_friVolStatus[i].m_volInfo) 00169 << endl; 00170 } 00171 log_DBG_m(dbg_NORM, msg.str()); 00172 00173 //check if all volumes on medium are open (no need to start BEA) 00174 bool allRead(true); 00175 bool medUnusable(false); 00176 for (UInt32_t i(0); i < medInfo.m_friVolStatus.size(); i++) { 00177 if (!medInfo.m_friVolStatus[i].m_read) { 00178 log_DBG_m(dbg_DETAIL,"Volume " << i << " not read."); 00179 allRead = false; 00180 //There are FRI that need to be read from medium 00181 if ((medium->status & rmdb_MEDIUM_UNUSABLE) || 00182 ((medium->status & rmdb_MEDIUM_UNRELIABLE) && a_autoCorrect && !a_removeMissingOnMedia)) { 00183 medUnusable = true; 00184 ostringstream msg; 00185 msg << "[" << m_iJobParams.jobID << "] Medium " << 00186 medium->barcode << 00187 " is marked unusable or unreliable and has closed volumes. " << 00188 "Job will not read FRI for this " << 00189 "volumes from this medium!"; 00190 00191 m_uiMsgWriter.DisplayWarning(msg.str()); 00192 log_WriteEvent(evt_WARNING, msg.str(), GetJobTypeText(), m_iJobParams.jobID); 00193 } 00194 break; 00195 } 00196 } 00197 00198 if (!medUnusable) { 00199 i_Resource_t allocRow; 00200 ipc_Init::ResourceInit(allocRow); 00201 00202 allocRow.resNum = 0; 00203 allocRow.blockSize = medInfo.m_friVolStatus[0].m_volInfo.blockSize; 00204 medInfo.m_medium = medium; 00205 00206 if (allRead) { 00207 log_DBG_m(dbg_DETAIL,"All volumes Read"); 00208 medInfo.m_allFriRead = true; 00209 } 00210 00211 00212 allocRow.barcode = medium->barcode; 00213 allocRow.mediumKey = medium->mediumKey; 00214 00215 resList.length(resList.length() + 1); 00216 allocRow.resNum = resList.length() - 1; 00217 resList[resList.length() - 1] = allocRow; 00218 00219 m_mediumInfoVec.push_back(medInfo); 00220 } 00221 } 00222 } //for 00223 00224 log_DBG_m(dbg_DETAIL," resList.length()" << resList.length() ); 00225 for (UInt32_t i(0); i < resList.length(); i++){ 00226 log_DBG_m(dbg_DETAIL," " << ipc_Log::LogResources(resList[i])); 00227 } 00228 SetResources(resList); 00229 }


| void i_MaintFriJob_i::PrepareVolumes | ( | i_MediumVolSeq_t & | a_medVolSeq, | |
| MediumInfo_t & | a_medInfo | |||
| ) |
Definition at line 232 of file i_maintfrijob_impl.cpp.
References i_Medium_t::blockSize, i_VolInfo_t::blockSize, dbg_DETAIL, dbg_LOW, dbg_NORM, cmn_Global::dirs, cmn_File::Exists(), ivd_Directories::fri, g_cmn, i_VOL_IVD, i_VolInfo_t::implID, ipc_Init::InitVolInfo(), ipc_EXEC_m, ipc_nilStr, log_DBG_m, log_FUNC_m, ipc_Log::LogMediumVol(), ipc_Log::LogVolInfo(), MediumInfo_t::m_friVolStatus, MediumInfo_t::m_medium, friVolStatus_t::m_open, friVolStatus_t::m_read, i_Job_i::m_rm, friVolStatus_t::m_volInfo, i_Medium_t::mediaPoolName, i_VolInfo_t::medVolID, i_VolInfo_t::partID, i_VolInfo_t::poolID, rmdb_DATA_VOLUME, rmdb_MEDVOL_FULL, rmdb_SYSTEM_VOLUME, i_MediumVol_t::status, i_VolInfo_t::sysVolNum, i_VolInfo_t::type, i_MediumVol_t::volType, and i_MediumVol_t::volUsed.
Referenced by PrepareMedium().
00233 { 00234 00235 00236 log_FUNC_m(PrepareVolumes); 00237 00238 //search for sysVol 00239 bool foundSysVol(false); 00240 00241 UInt32_t indexSysVol(0); 00242 for( ; indexSysVol < a_medVolSeq.length(); indexSysVol++){ 00243 00244 if (a_medVolSeq[indexSysVol].volType == rmdb_SYSTEM_VOLUME) { 00245 log_DBG_m(dbg_NORM, "Found system volume: " << 00246 a_medVolSeq[indexSysVol].medVolId); 00247 foundSysVol = true; 00248 break; 00249 } 00250 } 00251 if (!foundSysVol) indexSysVol = 0; 00252 00253 for (UInt32_t j(0); j < a_medVolSeq.length(); j++){ //for each volume 00254 00255 i_MediumVol_t &mediumVol = a_medVolSeq[j]; 00256 00257 if ( (mediumVol.volUsed > 0) && 00258 (mediumVol.volType == rmdb_DATA_VOLUME ) ) { 00259 //consider open volumes AND data volumes 00260 friVolStatus_t tmpFRIVolStatus; 00261 00262 log_DBG_m(dbg_DETAIL,"" << ipc_Log::LogMediumVol(mediumVol)); 00263 00264 i_VolInfo_t &volInfo = tmpFRIVolStatus.m_volInfo; 00265 00266 ipc_Init::InitVolInfo(volInfo, mediumVol); 00267 00268 volInfo.type = i_VOL_IVD; 00269 volInfo.implID = ipc_nilStr; 00270 if (foundSysVol) { 00271 volInfo.sysVolNum = indexSysVol + 1; 00272 } 00273 else { 00274 volInfo.sysVolNum = 0; 00275 } 00276 00277 log_DBG_m(dbg_DETAIL, "System volume index on Medium :" << 00278 indexSysVol); 00279 00280 ipc_EXEC_m ( 00281 00282 i_MediaPool_t_var pool; 00283 00284 pool = m_rm->SelectMediaPool(a_medInfo.m_medium.mediaPoolName); 00285 00286 volInfo.partID = 00287 CORBA::string_dup(pool->partitionUUIDString); 00288 // stringified UUID 00289 00290 volInfo.poolID = 00291 CORBA::string_dup(pool->poolUUIDString); 00292 // stringified UUID 00293 00294 volInfo.blockSize = 00295 a_medInfo.m_medium.blockSize; 00296 ); 00297 00298 a_medInfo.m_friVolStatus.push_back(tmpFRIVolStatus); 00299 00300 friVolStatus_t & friVolStatus = 00301 a_medInfo.m_friVolStatus[a_medInfo.m_friVolStatus.size() - 1]; 00302 00303 log_DBG_m(dbg_DETAIL,"push_back(friVolStatus);" << 00304 &a_medInfo.m_friVolStatus[a_medInfo.m_friVolStatus.size() - 1] << endl << 00305 ipc_Log::LogVolInfo(friVolStatus.m_volInfo)); 00306 00307 //check if volume is closed and 00308 //insert it into list of closed volumes 00309 00310 if ( (mediumVol.status & rmdb_MEDVOL_FULL) == 0){ 00311 //volume is NOT Full 00312 log_DBG_m(dbg_DETAIL,"Volume not full"); 00313 friVolStatus.m_open = true; 00314 } 00315 00316 // verify if FRI file exist 00317 try { 00318 log_DBG_m(dbg_DETAIL,"Read FRI from Disk"); 00319 00320 string medVol( friVolStatus.m_volInfo.medVolID); 00321 cmn_Path friFilePath(g_cmn.dirs.fri + medVol); 00322 cmn_File friFile(friFilePath); 00323 00324 if (!friFile.Exists()){ 00325 log_DBG_m(dbg_LOW, "FRI for that media volume is not on disk."); 00326 //it will be read from medium 00327 continue; 00328 } 00329 else { 00330 friVolStatus.m_read = true; 00331 } 00332 } 00333 catch (ivd_Exception& e){ 00334 log_DBG_m(dbg_DETAIL, " " << e); 00335 } 00336 } 00337 } 00338 }


| void i_MaintFriJob_i::CheckReadFri | ( | UInt32_t | a_beaNum | ) |
Definition at line 340 of file i_maintfrijob_impl.cpp.
References i_Medium_t::barcode, dbg_LOW, dbg_NORM, cmn_Global::dirs, ui_MsgWriter::DisplayMessage(), cmn_File::Exists(), ivd_Directories::fri, g_cmn, i_Job_i::GetJobTypeText(), i_JobParams::jobID, log_DBG_m, log_FUNC_m, log_WriteEvent(), MediumInfo_t::m_allFriRead, MediumInfo_t::m_friVolStatus, i_Job_i::m_iJobParams, MediumInfo_t::m_medium, m_mediumInfoVec, friVolStatus_t::m_read, m_uiMsgWriter, friVolStatus_t::m_volInfo, i_VolInfo_t::medVolID, and ivd_Directories::tmp.
Referenced by MediumOperationComplete().
00340 { 00341 log_FUNC_m(CheckReadFri); 00342 00343 bool allFriRead(true); 00344 MediumInfo_t &medInfo = m_mediumInfoVec[a_medNum]; 00345 00346 log_DBG_m(dbg_LOW, "Number of volumes on medium " << medInfo.m_medium.barcode 00347 << " is " << medInfo.m_friVolStatus.size()); 00348 //for each volume 00349 for (UInt32_t i(0); i < medInfo.m_friVolStatus.size(); i++) { 00350 00351 friVolStatus_t & friVolStatus = medInfo.m_friVolStatus[i]; 00352 log_DBG_m(dbg_LOW, "Checking fri for mediumvol: " << 00353 friVolStatus.m_volInfo.medVolID 00354 << ", friVolStatus.m_read = " << boolalpha << friVolStatus.m_read 00355 << ", allFriRead = " << boolalpha << allFriRead 00356 ); 00357 00358 if (friVolStatus.m_read) 00359 continue; //skip this volume it is already read 00360 00361 string medVol( friVolStatus.m_volInfo.medVolID); 00362 00363 //check on fri directory first 00364 cmn_Path friFilePath = g_cmn.dirs.fri + medVol; 00365 cmn_File friFile(friFilePath); 00366 00367 if (friFile.Exists()){ 00368 friVolStatus.m_read = true; 00369 log_DBG_m(dbg_NORM,"FRI for volume " << 00370 friVolStatus.m_volInfo.medVolID << " read" ); 00371 } 00372 else { 00373 log_DBG_m(dbg_LOW, "FRI for that mediumvol: " << medVol << 00374 " still not on disk."); 00375 friVolStatus.m_read = false; 00376 allFriRead = false; 00377 } 00378 00379 if (friVolStatus.m_read == false) { //now check also tmp directory 00380 cmn_Path tmpfriFilePath = g_cmn.dirs.tmp + string("fri") + medVol; 00381 cmn_File tmpfriFile(tmpfriFilePath); 00382 00383 if (tmpfriFile.Exists()){ 00384 friVolStatus.m_read = true; 00385 log_DBG_m(dbg_NORM,"FRI for volume " << 00386 friVolStatus.m_volInfo.medVolID << " read" ); 00387 } 00388 else { 00389 log_DBG_m(dbg_LOW, "FRI for that mediumvol: " << medVol << 00390 " still not on disk."); 00391 friVolStatus.m_read = false; 00392 allFriRead = false; 00393 } 00394 } 00395 } 00396 00397 //update medium info 00398 medInfo.m_allFriRead = allFriRead; 00399 00400 00401 if (medInfo.m_allFriRead) { 00402 log_DBG_m(dbg_LOW,"All Fri written to disk"); 00403 } 00404 else { 00405 for (UInt32_t i(0); i < medInfo.m_friVolStatus.size(); i++) { 00406 friVolStatus_t & friVolStatus = medInfo.m_friVolStatus[i]; 00407 if ( !friVolStatus.m_read){ 00408 ostringstream msg; 00409 msg << "Medium: " << medInfo.m_medium.barcode << 00410 ", FRI: " << friVolStatus.m_volInfo.medVolID << 00411 " could not be read. Recreating ... "; 00412 log_DBG_m(dbg_LOW, msg.str()); 00413 00414 m_uiMsgWriter.DisplayMessage(msg.str()); 00415 log_WriteEvent(msg.str(), GetJobTypeText(), m_iJobParams.jobID); 00416 } 00417 00418 } 00419 00420 } 00421 }


| void i_MaintFriJob_i::RequestResources | ( | ) |
RM-> ask for resources
Definition at line 839 of file i_maintfrijob_impl.cpp.
References dbg_LOW, dbg_NORM, EndOfFRIInput(), i_Job_i::GetResources(), i_SUCCEDED, i_UNKNOWN, InsertToFriProcessor(), ipc_EXEC_m, i_Job_i::IsAborted(), job_MED_PROC, log_DBG_m, log_FUNC_m, ipc_Log::LogResources(), m_allFriRead, i_Job_i::m_iJob, i_Job_i::m_iJobParams, m_mediumInfoVec, friVolStatus_t::m_read, i_Job_i::m_rm, i_Job_i::m_status, friVolStatus_t::m_volInfo, i_Job_i::SetResMedOpComplete(), i_Job_i::SetResRequested(), i_Job_i::SetStatus(), and i_VolInfo_t::volNum.
Referenced by Execute().
00839 { 00840 log_FUNC_m(RequestResources); 00841 log_DBG_m(dbg_NORM,"Will call RM->GetResources now"); 00842 00843 if (IsAborted()) 00844 return; 00846 ipc_EXEC_m( 00847 SetStatus(job_MED_PROC); 00848 00849 bool needResources(false); 00850 for (UInt32_t i = 0; i < GetResources().length(); i++ ) { 00851 if (!m_mediumInfoVec[i].m_allFriRead) { 00852 log_DBG_m(dbg_LOW,"Requesting Resources for " << 00853 ipc_Log::LogResources(GetResources()[i])); 00854 needResources = true; 00855 log_DBG_m(dbg_LOW,"Request resource for " << i << "."); 00856 SetResRequested(i); 00857 00858 i_ResourceList_t resList; 00859 resList.length(1); 00860 resList[0] = GetResources()[i]; 00861 m_rm->GetResources(m_iJob, m_iJobParams, resList); 00862 00863 //vol open volumes inform fri_processor 00864 for (UInt32_t j(0); j < m_mediumInfoVec[i].m_friVolStatus.size();j++){ 00865 friVolStatus_t & fri = m_mediumInfoVec[i].m_friVolStatus[j]; 00866 if (fri.m_read){ 00867 pm_FRIInfo friInfo(i, fri.m_volInfo.volNum, 0); 00868 InsertToFriProcessor(friInfo); 00869 } 00870 } 00871 } 00872 else { 00873 SetResMedOpComplete(i); 00874 00875 log_DBG_m(dbg_LOW,"FRI for resource " << i << " already read."); 00876 for (UInt32_t j(0); j < m_mediumInfoVec[i].m_friVolStatus.size();j++){ 00877 friVolStatus_t & fri = m_mediumInfoVec[i].m_friVolStatus[j]; 00878 pm_FRIInfo friInfo(i, fri.m_volInfo.volNum, 0); 00879 InsertToFriProcessor(friInfo); 00880 } 00881 }; 00882 }; //for all resources 00883 00884 if(!needResources) { 00885 log_DBG_m(dbg_LOW, "No resources needed for this job"); 00886 EndOfFRIInput(); 00887 if (m_status == i_UNKNOWN){ 00888 m_status = i_SUCCEDED; 00889 } 00890 } 00891 ); 00892 }


| void i_MaintFriJob_i::ReleaseResources | ( | UInt32_t | a_medNum | ) |
Definition at line 895 of file i_maintfrijob_impl.cpp.
References dbg_DETAIL, 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, i_Job_i::SetResProcessed(), and i_Job_i::SetResReleased().
Referenced by CompleteJob(), and MediumOperationComplete().
00895 { 00896 log_FUNC_m(ReleaseResources); 00897 log_DBG_m(dbg_DETAIL,"Freeing up resources"); 00898 00899 { //free up resources 00900 try { 00901 log_DBG_m(dbg_LOW, "ReleaseResource for jobId:" << m_iJobParams.jobID); 00902 i_ResourceList_t resList; 00903 ipc_EXEC_m( 00904 resList.length(1); 00905 resList[0] = GetResources()[a_medNum]; 00906 m_rm->ReleaseResource(m_iJobParams, resList); 00907 ); 00908 SetResReleased(a_medNum); 00909 SetResProcessed(a_medNum); 00910 } catch (ivd_Exception& e) { 00911 log_ERR_m("Caught exception in ReleaseResource: " << e); 00912 } catch (...){ 00913 log_ERR_m("Caught UNKNOWN EXCEPTION " ); 00914 } 00915 00916 log_DBG_m(dbg_NORM,"Resources Released for jobId" << m_iJobParams.jobID); 00917 } 00918 }


| bool i_MaintFriJob_i::AllBeaFinished | ( | ) |
Definition at line 540 of file i_maintfrijob_impl.cpp.
References dbg_LOW, dbg_NORM, log_DBG_m, log_FUNC_m, m_allFriRead, and m_mediumInfoVec.
Referenced by MediumOperationComplete().
00540 { 00541 log_FUNC_m(AllBeaFinished()); 00542 00543 for (UInt32_t i(0); i < m_mediumInfoVec.size(); i++){ 00544 if (!(m_mediumInfoVec[i].m_beaFinished || 00545 m_mediumInfoVec[i].m_allFriRead) ) { 00546 log_DBG_m(dbg_NORM,"bea:" << i << 00547 " m_beaFinished:" << boolalpha << 00548 m_mediumInfoVec[i].m_beaFinished << 00549 ", m_allFriRead:" << boolalpha << 00550 m_mediumInfoVec[i].m_allFriRead); 00551 return false; 00552 } 00553 00554 } 00555 log_DBG_m(dbg_LOW,"All bea finished"); 00556 return true; 00557 }

| void i_MaintFriJob_i::AbortFriProcessor | ( | ) |
Definition at line 976 of file i_maintfrijob_impl.cpp.
References pm_FriProcessor::Aborted(), dbg_LOW, log_DBG_m, log_FUNC_m, m_friProcessor, m_friProcessor_x, and NULL.
Referenced by CompleteJob().
00976 { 00977 log_FUNC_m(AbortFriProcessor); 00978 cmn_MutexLock l(m_friProcessor_x); 00979 if (m_friProcessor == NULL){ 00980 log_DBG_m(dbg_LOW, "FRI processor is NULL"); 00981 } else { 00982 m_friProcessor->Aborted(); 00983 m_friProcessor = NULL; 00984 } 00985 }


| void i_MaintFriJob_i::InsertToFriProcessor | ( | pm_FRIInfo | a_friInfo | ) |
Definition at line 987 of file i_maintfrijob_impl.cpp.
References dbg_LOW, pm_FriProcessor::Insert(), log_DBG_m, log_FUNC_m, m_friProcessor, m_friProcessor_x, and NULL.
Referenced by FRIReadSuccess(), and RequestResources().
00987 { 00988 log_FUNC_m(InsertToFriProcessor); 00989 00990 cmn_MutexLock l(m_friProcessor_x); 00991 if (m_friProcessor == NULL){ 00992 log_DBG_m(dbg_LOW, "FRI processor is NULL"); 00993 } else { 00994 m_friProcessor->Insert(a_friInfo); 00995 } 00996 }


| void i_MaintFriJob_i::EndOfFRIInput | ( | ) |
Definition at line 998 of file i_maintfrijob_impl.cpp.
References pm_FriProcessor::Completed(), dbg_LOW, log_DBG_m, log_FUNC_m, m_friProcessor, m_friProcessor_x, and NULL.
Referenced by MediumOperationComplete(), and RequestResources().
00998 { 00999 log_FUNC_m(EndOfFRIInput); 01000 cmn_MutexLock l(m_friProcessor_x); 01001 if (m_friProcessor == NULL){ 01002 log_DBG_m(dbg_LOW, "FRI processor is NULL"); 01003 } else { 01004 m_friProcessor->Completed(); 01005 } 01006 }


friend class pm_AssignResThread [friend] |
Definition at line 75 of file i_maintfrijob_impl.h.
Definition at line 109 of file i_maintfrijob_impl.h.
Referenced by MediumOperationComplete(), i_RecoveryJob_i::ProcessFRI(), and i_RecoveryJob_i::~i_RecoveryJob_i().
i_PartitionManager_i& i_MaintFriJob_i::m_iPM [protected] |
Reimplemented in i_MediumCheckJob_i.
Definition at line 113 of file i_maintfrijob_impl.h.
Referenced by i_MaintFriJob_i(), i_RecoveryJob_i::i_RecoveryJob_i(), i_RecoveryJob_i::ProcessFRI(), and i_RecoveryJob_i::~i_RecoveryJob_i().
vector<MediumInfo_t> i_MaintFriJob_i::m_mediumInfoVec [protected] |
Definition at line 114 of file i_maintfrijob_impl.h.
Referenced by AllBeaFinished(), CheckReadFri(), FRIReadSuccess(), GetFRI(), MediumOperationComplete(), PrepareMedium(), i_RecoveryJob_i::ProcessFRI(), i_MediumCheckJob_i::ProcessFRI(), RecreateFRI(), RequestResources(), i_RecoveryJob_i::SetRecoveryFlagOnVolumes(), and ~i_MaintFriJob_i().
cmn_ThreadCounter i_MaintFriJob_i::m_threadCnt [protected] |
Definition at line 115 of file i_maintfrijob_impl.h.
Referenced by CompleteJob(), and i_MaintFriJob_i().
Definition at line 138 of file i_maintfrijob_impl.h.
Referenced by AllBeaFinished(), and RequestResources().
Definition at line 140 of file i_maintfrijob_impl.h.
Referenced by AbortFriProcessor(), EndOfFRIInput(), i_MaintFriJob_i(), and InsertToFriProcessor().
Definition at line 141 of file i_maintfrijob_impl.h.
Referenced by AbortFriProcessor(), EndOfFRIInput(), and InsertToFriProcessor().
Definition at line 142 of file i_maintfrijob_impl.h.
Referenced by CheckReadFri(), i_MediumCheckJob_i::CompleteJob(), CompleteJob(), i_MediumCheckJob_i::Execute(), i_MaintFriJob_i(), i_MediumCheckJob_i::i_MediumCheckJob_i(), i_RecoveryJob_i::i_RecoveryJob_i(), MediumOperationComplete(), PrepareMedium(), Process(), i_RecoveryJob_i::ProcessFRI(), i_MediumCheckJob_i::ProcessFRI(), and ~i_MaintFriJob_i().
Reimplemented from i_Job_i.
Reimplemented in i_MediumCheckJob_i, and i_RecoveryJob_i.
Definition at line 146 of file i_maintfrijob_impl.h.
1.5.6