i_ReorgScanJob_i Class Reference
[Partition Manager]

#include <i_reorgscanjob_impl.h>

Inheritance diagram for i_ReorgScanJob_i:

Inheritance graph
[legend]
Collaboration diagram for i_ReorgScanJob_i:

Collaboration graph
[legend]

List of all members.


Detailed Description

Definition at line 21 of file i_reorgscanjob_impl.h.


Public Member Functions

 i_ReorgScanJob_i (pm_JobMgr &a_jobMgr, i_PartitionManager_i &a_iPM, ivd_Time32_t a_time, UInt32_t a_numOfGen, i_UIMessageServer_ptr a_uims)
virtual ~i_ReorgScanJob_i ()
void AbortJob ()

Public Attributes

 log_CLASSID_m

Protected Member Functions

void Execute ()

Protected Attributes

ivd_Time32_t m_time
UInt32_t m_numOfGen

Constructor & Destructor Documentation

i_ReorgScanJob_i::i_ReorgScanJob_i ( pm_JobMgr a_jobMgr,
i_PartitionManager_i a_iPM,
ivd_Time32_t  a_time,
UInt32_t  a_numOfGen,
i_UIMessageServer_ptr  a_uims 
)

Definition at line 40 of file i_reorgscanjob_impl.cpp.

References log_FUNC_m, i_ThreadJob_i::m_iPM, and i_PartitionManager_i::SetReorgScan().

00045     : i_ThreadJob_i(a_jobMgr, a_iPM, a_uims),
00046       m_time(a_time),
00047       m_numOfGen(a_numOfGen)
00048 {
00049     log_FUNC_m(i_ReorgScanJob_i);
00050     m_iPM.SetReorgScan();
00051 }

Here is the call graph for this function:

i_ReorgScanJob_i::~i_ReorgScanJob_i (  )  [virtual]

Definition at line 53 of file i_reorgscanjob_impl.cpp.

References i_PartitionManager_i::ClearReorgScan(), i_SUCCEDED, log_FUNC_m, i_ThreadJob_i::m_iPM, and i_Job_i::m_status.

00053                                    {
00054     log_FUNC_m(~i_ReorgScanJob_i);
00055 
00056     if (m_status == i_SUCCEDED){
00057         m_iPM.ClearReorgScan(true);
00058     } else {
00059         m_iPM.ClearReorgScan(false);
00060     }
00061 }

Here is the call graph for this function:


Member Function Documentation

void i_ReorgScanJob_i::AbortJob (  )  [virtual]

Reimplemented from i_Job_i.

Definition at line 64 of file i_reorgscanjob_impl.cpp.

References i_Job_i::AbortJob(), and log_FUNC_m.

00064                                {
00065     log_FUNC_m(AbortJob);
00066     i_Job_i::AbortJob();
00067 
00068     //NYI
00069     //m_iPM.m_iFSCi->ReorgScanAbort();
00070 }

Here is the call graph for this function:

void i_ReorgScanJob_i::Execute (  )  [protected, virtual]

Implements i_ThreadJob_i.

Definition at line 72 of file i_reorgscanjob_impl.cpp.

References cfg_MEGABYTE, dbg_NORM, ui_MsgWriter::DisplayMessage(), evt_ERROR, g_cmn, i_Job_i::GetJobTypeText(), i_FAILED, ipc_EXEC_m, i_JobParams::jobID, log_DBG_m, log_FUNC_m, log_WriteEvent(), i_PartitionManager_i::m_iFSCi, i_Job_i::m_iJobParams, i_ThreadJob_i::m_iPM, ivd_Product::m_nameShortLC, m_numOfGen, i_Job_i::m_rm, i_Job_i::m_status, m_time, i_ThreadJob_i::m_uiMsgWriter, ivd_ScanInfo_t::mediumKey, ivd_ScanInfo_t::medvolNum, i_JobParams::partName, cmn_Global::prod, i_FSC_i::ReorgScan(), ivd_ScanInfo_t::reorgSize, and ivd_ScanInfo_t::totalSize.

00072                               {
00073     log_FUNC_m(Execute);
00074     m_status = i_FAILED;
00075     try {
00076         
00077 //[11:42:10] Scanning FSC for reorganization info.
00078 //[11:42:10] Scan Parameters: 2003/11/26 15:25:13, generations: 3.
00079 //will be written by FSC [11:55:22] Scanning complete. Scanned 33.005.664 file generation copies.       
00080            
00081         ostringstream msg;
00082         msg << "Scanning FSC for reorganization info.";
00083         m_uiMsgWriter.DisplayMessage(msg.str());
00084         log_WriteEvent(msg.str(), GetJobTypeText(), m_iJobParams.jobID);
00085 
00086         msg.str("");
00087         msg << "Scan Parameters: \"" << cmn_Time(m_time).Time2YMDhms() 
00088             << "\" , generations: " << m_numOfGen << ".";
00089         m_uiMsgWriter.DisplayMessage(msg.str());
00090         log_WriteEvent(msg.str(), GetJobTypeText(), m_iJobParams.jobID);
00091         //set all volumes that contain data to reorg scan
00092 
00093         ipc_EXEC_m(m_rm->SetReorgScan(m_iJobParams.partName));
00094 
00095         ivd_ScanInfo_v_t reorgResult = m_iPM.m_iFSCi->ReorgScan(m_time, m_numOfGen);
00096         ivd_ScanInfo_v_i iter = reorgResult.begin();
00097         for (; iter != reorgResult.end(); iter++) {
00098             ivd_ScanInfo_t scanInfo = *iter;
00099             
00100             try {
00101                 log_DBG_m(dbg_NORM, "mediumKey:" << scanInfo.mediumKey <<
00102                                     ", medvolNum:" << scanInfo.medvolNum <<
00103                                     ", totalSize:" << scanInfo.totalSize <<
00104                                     ", reorgSize:" << scanInfo.reorgSize);
00105                 ipc_EXEC_m(
00106                     i_VolSize_t validData(0);
00107                     if (scanInfo.reorgSize >= cfg_MEGABYTE) {
00108                         validData = static_cast<i_VolSize_t>(scanInfo.reorgSize/cfg_MEGABYTE);
00109                     } else if (scanInfo.reorgSize > 0 ){
00110                         validData = 1; //if less the 1M just round UP to 1M
00111                     }
00112                     //validData is 0 ONLY if no data needs to be reorganized
00113 
00114                     i_VolSize_t totalData(0);
00115                     if (scanInfo.totalSize >= cfg_MEGABYTE) {
00116                         totalData = static_cast<i_VolSize_t>(scanInfo.totalSize/cfg_MEGABYTE);
00117                     }
00118                     else if (scanInfo.totalSize > 0 ){
00119                         totalData = 1; //if less the 1M just round UP to 1M
00120                     }
00121                     log_DBG_m(dbg_NORM, "totalData" << totalData << 
00122                                         " validData" << validData);
00123 
00124                     ipc_EXEC_m(
00125                         m_rm->UpdateDataSize(   scanInfo.mediumKey, 
00126                                                 scanInfo.medvolNum, 
00127                                                 totalData,
00128                                                 validData
00129                                                 );
00130                     );
00131                 )
00132             } catch (ivd_Error &e){
00133                 ostringstream msg;
00134                 msg << "Error while updating rmdb with scan info: " << e;
00135                 m_uiMsgWriter.DisplayMessage(msg.str());
00136                 log_WriteEvent(evt_ERROR, msg.str(), GetJobTypeText(), m_iJobParams.jobID);
00137                 //ingnore and continue
00138             }
00139         }//for
00140     
00141         //[11:55:23] Use ivdpartition -reorg-stat to see the details.
00142         msg.str("");
00143         msg << "Use '" << g_cmn.prod.m_nameShortLC 
00144             << "partition --reorg-stat' to see the details.";
00145         m_uiMsgWriter.DisplayMessage(msg.str());
00146         log_WriteEvent(msg.str(), GetJobTypeText(), m_iJobParams.jobID);
00147 
00148         
00149     }
00150     catch (ivd_Exception &e) {
00151         m_uiMsgWriter.DisplayMessage("Reorganization scan failed. " + e.GetFriendly());
00152         throw;
00153     }
00154     catch (std::exception &stde) {
00155         log_ERR_m(stde.what());
00156         throw ivd_Error(ie_STD_EXCEPTION, stde.what());
00157     }
00158     catch (...) {
00159         throw ivd_InternalError(ie_FATAL_ERROR, "Unknown exception caught");
00160     }
00161     m_status = i_SUCCEDED;    
00162 }

Here is the call graph for this function:


Member Data Documentation

Reimplemented from i_ThreadJob_i.

Definition at line 32 of file i_reorgscanjob_impl.h.

Definition at line 36 of file i_reorgscanjob_impl.h.

Referenced by Execute().

Definition at line 37 of file i_reorgscanjob_impl.h.

Referenced by Execute().


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

Generated on Mon Feb 27 19:39:28 2012 for OPENARCHIVE by  doxygen 1.5.6