Public Member Functions | Public Attributes | Private Attributes

fsc_RawMedVolCollector Class Reference
[G_new_group]

#include <fsc_RawMedVolCollector.h>

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

List of all members.

Public Member Functions

 fsc_RawMedVolCollector (const cmn_Path &a_fscDirectory)
virtual ~fsc_RawMedVolCollector ()
virtual bool ProcFileID (ivd_RecordIDX_t a_fileID)
 this method is called by fsc_DataL objekt to collect FileID
virtual bool ProcRecGeneration (fsc_Generation_t &a_gen, UInt32_t a_status)
 this method is called by fsc_Generation objekt to collect GenID and Size
virtual bool ProcRecCopy (fsc_Copy_t &a_copy)
 ProcRecCopy is add just to check consistency between generation and its copies.
virtual bool ProcRecSplit (fsc_Split_t &a_split)
 this method is called by fsc_Split to collect split offset and size
virtual bool ProcRecMedPosMgr (fsc_MediaPosition_t &a_medPos)
 this method is called by fsc_MedPosMgs to collect media's block offset
UInt32_t GetSplitCounter ()

Public Attributes

 log_CLASSID_m

Private Attributes

fsc_medVolData_t m_medVolData
 to collect each split info
const cmn_Path m_fscDirectory
 where to store files
UInt8_t m_dataType
 each generation set this member
stx_Cache m_cache
 MedVolume file storage.
UInt32_t m_splitCounter
UInt32_t m_copyCounter

Detailed Description

Definition at line 48 of file fsc_RawMedVolCollector.h.


Constructor & Destructor Documentation

fsc_RawMedVolCollector::fsc_RawMedVolCollector ( const cmn_Path a_fscDirectory  ) 

Definition at line 55 of file fsc_RawMedVolCollector.cpp.

References cmn_CleanDir(), cmn_CreatePath(), fsc_byVolDir_c, and log_FUNC_m.

    :
    m_fscDirectory(a_fscDirectory),
    m_cache(1024 * 64), // for fast access to volume Files
    m_splitCounter(0),
    m_copyCounter(0)
{
    log_FUNC_m(fsc_RawMedVolCollector);    
    //todo clean directory
    cmn_Path byVol(a_fscDirectory + fsc_byVolDir_c);
    cmn_CreatePath(byVol);
    cmn_CleanDir(byVol);
}

Here is the call graph for this function:

fsc_RawMedVolCollector::~fsc_RawMedVolCollector (  )  [virtual]

Definition at line 70 of file fsc_RawMedVolCollector.cpp.

References log_FUNC_m.


Member Function Documentation

UInt32_t fsc_RawMedVolCollector::GetSplitCounter (  )  [inline]

Definition at line 78 of file fsc_RawMedVolCollector.h.

{ return m_splitCounter;};

bool fsc_RawMedVolCollector::ProcFileID ( ivd_RecordIDX_t  a_fileID  )  [virtual]

this method is called by fsc_DataL objekt to collect FileID

Reimplemented from fsc_RawCollector.

Definition at line 75 of file fsc_RawMedVolCollector.cpp.

References fsc_medVolData_t::fileID, and m_medVolData.

                                                                {
    fsc_RawCollector::ProcFileID(a_fileID);
    m_medVolData.fileID = a_fileID;
    return true;
}

bool fsc_RawMedVolCollector::ProcRecCopy ( fsc_Copy_t a_copy  )  [virtual]

ProcRecCopy is add just to check consistency between generation and its copies.

Reimplemented from fsc_RawCollector.

Definition at line 96 of file fsc_RawMedVolCollector.cpp.

References fsc_NextEntity_t::dataType, fsc_medVolData_t::dataType, log_FUNC_m, m_copyCounter, m_medVolData, and fsc_Copy_t::nextEntity.

                                                           {
    log_FUNC_m(ProcRecCopy);      
    m_copyCounter++;
    // Generation may have H and D, but copy not.
    // If some migration is aborted this is known at BSE status.
    // Unfortunately if file is splitted, this first split does not know that 
    // file is not consistent, so update generation as Data is in it.
    m_medVolData.dataType = a_copy.nextEntity.dataType;
    return true;
}

bool fsc_RawMedVolCollector::ProcRecGeneration ( fsc_Generation_t a_gen,
UInt32_t  a_status 
) [virtual]
bool fsc_RawMedVolCollector::ProcRecMedPosMgr ( fsc_MediaPosition_t a_medPos  )  [virtual]

this method is called by fsc_MedPosMgs to collect media's block offset

Reimplemented from fsc_RawCollector.

Definition at line 117 of file fsc_RawMedVolCollector.cpp.

References fsc_MediaPosition_t::blockOffset, fsc_medVolData_t::blockOffset, fsc_medVolData_t::dataSize, fsc_medVolData_t::dataType, stx_Cache::Get(), stx_Cache::Insert(), fsc_MedVolWriter::KeyGen(), m_cache, m_dataType, m_fscDirectory, m_medVolData, m_splitCounter, fsc_MediaPosition_t::mediaKey, fsc_MediaPosition_t::medVolNum, NULL, fsc_medVolData_t::splitOffset, fsc_medVolData_t::splitSize, and fsc_MedVolWriter::Write().

                                                                          {
//    log_FUNC_m(ProcRecMedPosMgr);      

    m_splitCounter++;
    
    m_medVolData.blockOffset = a_medPos.blockOffset;

    UInt64_t key = fsc_MedVolWriter::KeyGen(a_medPos.mediaKey, 
                                            a_medPos.medVolNum,
                                            a_medPos.blockOffset);

    fsc_MedVolWriter *medVol = (fsc_MedVolWriter*)(m_cache.Get(key));
    if (medVol == NULL) {
        medVol = new fsc_MedVolWriter(m_fscDirectory,
                                      a_medPos.mediaKey, 
                                      a_medPos.medVolNum,
                                      a_medPos.blockOffset);
        m_cache.Insert(medVol);
    }
   
    medVol->Write(&m_medVolData);

    // set to whole size, that other copies of same generation has splitSize set properlly
    m_medVolData.splitOffset = 0;
    m_medVolData.splitSize   = m_medVolData.dataSize;
    m_medVolData.dataType    = m_dataType;
    return true;
}

Here is the call graph for this function:

bool fsc_RawMedVolCollector::ProcRecSplit ( fsc_Split_t a_split  )  [virtual]

this method is called by fsc_Split to collect split offset and size

Reimplemented from fsc_RawCollector.

Definition at line 108 of file fsc_RawMedVolCollector.cpp.

References fsc_Split_t::dataOffset, fsc_Split_t::dataSize, fsc_NextEntity_t::dataType, fsc_medVolData_t::dataType, m_medVolData, fsc_Split_t::nextEntity, fsc_medVolData_t::splitOffset, and fsc_medVolData_t::splitSize.

                                                              {
//    log_FUNC_m(ProcRecSplit);      
    m_medVolData.splitOffset = a_split.dataOffset;
    m_medVolData.splitSize   = a_split.dataSize;
    m_medVolData.dataType    = a_split.nextEntity.dataType;
    return true;
}


Member Data Documentation

Reimplemented from fsc_RawCollector.

Definition at line 78 of file fsc_RawMedVolCollector.h.

MedVolume file storage.

Definition at line 95 of file fsc_RawMedVolCollector.h.

Referenced by ProcRecMedPosMgr().

Definition at line 99 of file fsc_RawMedVolCollector.h.

Referenced by ProcRecCopy(), and ProcRecGeneration().

each generation set this member

Definition at line 92 of file fsc_RawMedVolCollector.h.

Referenced by ProcRecGeneration(), and ProcRecMedPosMgr().

where to store files

Definition at line 89 of file fsc_RawMedVolCollector.h.

Referenced by ProcRecMedPosMgr().

to collect each split info

Definition at line 86 of file fsc_RawMedVolCollector.h.

Referenced by ProcFileID(), ProcRecCopy(), ProcRecGeneration(), ProcRecMedPosMgr(), and ProcRecSplit().

Definition at line 97 of file fsc_RawMedVolCollector.h.

Referenced by ProcRecMedPosMgr().


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