Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

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.

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

Detailed Description

Definition at line 35 of file i_reorgscanjob_impl.h.


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 54 of file i_reorgscanjob_impl.cpp.

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

    : i_ThreadJob_i(a_jobMgr, a_iPM, a_uims),
      m_time(a_time),
      m_numOfGen(a_numOfGen)
{
    log_FUNC_m(i_ReorgScanJob_i);
    m_iPM.SetReorgScan();
}

Here is the call graph for this function:

i_ReorgScanJob_i::~i_ReorgScanJob_i (  )  [virtual]

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

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 78 of file i_reorgscanjob_impl.cpp.

References log_FUNC_m.

                               {
    log_FUNC_m(AbortJob);
    i_Job_i::AbortJob();

    //NYI
    //m_iPM.m_iFSCi->ReorgScanAbort();
}

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

Implements i_ThreadJob_i.

Definition at line 86 of file i_reorgscanjob_impl.cpp.

References cfg_MEGABYTE, dbg_NORM, ui_MsgWriter::DisplayMessage(), evt_ERROR, g_cmn, i_Job_i::GetJobTypeText(), 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.

                              {
    log_FUNC_m(Execute);
    m_status = i_FAILED;
    try {
        
//[11:42:10] Scanning FSC for reorganization info.
//[11:42:10] Scan Parameters: 2003/11/26 15:25:13, generations: 3.
//will be written by FSC [11:55:22] Scanning complete. Scanned 33.005.664 file generation copies.       
           
        ostringstream msg;
        msg << "Scanning FSC for reorganization info.";
        m_uiMsgWriter.DisplayMessage(msg.str());
        log_WriteEvent(msg.str(), GetJobTypeText(), m_iJobParams.jobID);

        msg.str("");
        msg << "Scan Parameters: \"" << cmn_Time(m_time).Time2YMDhms() 
            << "\" , generations: " << m_numOfGen << ".";
        m_uiMsgWriter.DisplayMessage(msg.str());
        log_WriteEvent(msg.str(), GetJobTypeText(), m_iJobParams.jobID);
        //set all volumes that contain data to reorg scan

        ipc_EXEC_m(m_rm->SetReorgScan(m_iJobParams.partName));

        ivd_ScanInfo_v_t reorgResult = m_iPM.m_iFSCi->ReorgScan(m_time, m_numOfGen);
        ivd_ScanInfo_v_i iter = reorgResult.begin();
        for (; iter != reorgResult.end(); iter++) {
            ivd_ScanInfo_t scanInfo = *iter;
            
            try {
                log_DBG_m(dbg_NORM, "mediumKey:" << scanInfo.mediumKey <<
                                    ", medvolNum:" << scanInfo.medvolNum <<
                                    ", totalSize:" << scanInfo.totalSize <<
                                    ", reorgSize:" << scanInfo.reorgSize);
                ipc_EXEC_m(
                    i_VolSize_t validData(0);
                    if (scanInfo.reorgSize >= cfg_MEGABYTE) {
                        validData = static_cast<i_VolSize_t>(scanInfo.reorgSize/cfg_MEGABYTE);
                    } else if (scanInfo.reorgSize > 0 ){
                        validData = 1; //if less the 1M just round UP to 1M
                    }
                    //validData is 0 ONLY if no data needs to be reorganized

                    i_VolSize_t totalData(0);
                    if (scanInfo.totalSize >= cfg_MEGABYTE) {
                        totalData = static_cast<i_VolSize_t>(scanInfo.totalSize/cfg_MEGABYTE);
                    }
                    else if (scanInfo.totalSize > 0 ){
                        totalData = 1; //if less the 1M just round UP to 1M
                    }
                    log_DBG_m(dbg_NORM, "totalData" << totalData << 
                                        " validData" << validData);

                    ipc_EXEC_m(
                        m_rm->UpdateDataSize(   scanInfo.mediumKey, 
                                                scanInfo.medvolNum, 
                                                totalData,
                                                validData
                                                );
                    );
                )
            } catch (ivd_Error &e){
                ostringstream msg;
                msg << "Error while updating rmdb with scan info: " << e;
                m_uiMsgWriter.DisplayMessage(msg.str());
                log_WriteEvent(evt_ERROR, msg.str(), GetJobTypeText(), m_iJobParams.jobID);
                //ingnore and continue
            }
        }//for
    
        //[11:55:23] Use ivdpartition -reorg-stat to see the details.
        msg.str("");
        msg << "Use '" << g_cmn.prod.m_nameShortLC 
            << "partition --reorg-stat' to see the details.";
        m_uiMsgWriter.DisplayMessage(msg.str());
        log_WriteEvent(msg.str(), GetJobTypeText(), m_iJobParams.jobID);

        
    }
    catch (ivd_Exception &e) {
        m_uiMsgWriter.DisplayMessage("Reorganization scan failed. " + e.GetFriendly());
        throw;
    }
    catch (std::exception &stde) {
        log_ERR_m(stde.what());
        throw ivd_Error(ie_STD_EXCEPTION, stde.what());
    }
    catch (...) {
        throw ivd_InternalError(ie_FATAL_ERROR, "Unknown exception caught");
    }
    m_status = i_SUCCEDED;    
}

Here is the call graph for this function:


Member Data Documentation

Reimplemented from i_ThreadJob_i.

Definition at line 46 of file i_reorgscanjob_impl.h.

Definition at line 51 of file i_reorgscanjob_impl.h.

Referenced by Execute().

Definition at line 50 of file i_reorgscanjob_impl.h.

Referenced by Execute().


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