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.


Detailed Description

Definition at line 34 of file fsc_RawMedVolCollector.h.


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

Constructor & Destructor Documentation

fsc_RawMedVolCollector::fsc_RawMedVolCollector ( const cmn_Path a_fscDirectory  ) 

Definition at line 41 of file fsc_RawMedVolCollector.cpp.

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

00042     :
00043     m_fscDirectory(a_fscDirectory),
00044     m_cache(1024 * 64), // for fast access to volume Files
00045     m_splitCounter(0),
00046     m_copyCounter(0)
00047 {
00048     log_FUNC_m(fsc_RawMedVolCollector);    
00049     //todo clean directory
00050     cmn_Path byVol(a_fscDirectory + fsc_byVolDir_c);
00051     cmn_CreatePath(byVol);
00052     cmn_CleanDir(byVol);
00053 }
//============================================================================//

Here is the call graph for this function:

fsc_RawMedVolCollector::~fsc_RawMedVolCollector (  )  [virtual]

Definition at line 56 of file fsc_RawMedVolCollector.cpp.

References log_FUNC_m.

00056                                                 {
00057     log_FUNC_m(~fsc_RawMedVolCollector);        
00058 }


Member Function Documentation

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 61 of file fsc_RawMedVolCollector.cpp.

References fsc_medVolData_t::fileID, m_medVolData, and fsc_RawCollector::ProcFileID().

00061                                                                 {
00062     fsc_RawCollector::ProcFileID(a_fileID);
00063     m_medVolData.fileID = a_fileID;
00064     return true;
00065 }

Here is the call graph for this function:

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

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 82 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.

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

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 94 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.

00094                                                               {
00095 //    log_FUNC_m(ProcRecSplit);      
00096     m_medVolData.splitOffset = a_split.dataOffset;
00097     m_medVolData.splitSize   = a_split.dataSize;
00098     m_medVolData.dataType    = a_split.nextEntity.dataType;
00099     return true;
00100 }

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 103 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().

00103                                                                           {
00104 //    log_FUNC_m(ProcRecMedPosMgr);      
00105 
00106     m_splitCounter++;
00107     
00108     m_medVolData.blockOffset = a_medPos.blockOffset;
00109 
00110     UInt64_t key = fsc_MedVolWriter::KeyGen(a_medPos.mediaKey, 
00111                                             a_medPos.medVolNum,
00112                                             a_medPos.blockOffset);
00113 
00114     fsc_MedVolWriter *medVol = (fsc_MedVolWriter*)(m_cache.Get(key));
00115     if (medVol == NULL) {
00116         medVol = new fsc_MedVolWriter(m_fscDirectory,
00117                                       a_medPos.mediaKey, 
00118                                       a_medPos.medVolNum,
00119                                       a_medPos.blockOffset);
00120         m_cache.Insert(medVol);
00121     }
00122    
00123     medVol->Write(&m_medVolData);
00124 
00125     // set to whole size, that other copies of same generation has splitSize set properlly
00126     m_medVolData.splitOffset = 0;
00127     m_medVolData.splitSize   = m_medVolData.dataSize;
00128     m_medVolData.dataType    = m_dataType;
00129     return true;
00130 }

Here is the call graph for this function:

UInt32_t fsc_RawMedVolCollector::GetSplitCounter (  )  [inline]

Definition at line 64 of file fsc_RawMedVolCollector.h.

00064 { return m_splitCounter;};


Member Data Documentation

Reimplemented from fsc_RawCollector.

Definition at line 64 of file fsc_RawMedVolCollector.h.

to collect each split info

Definition at line 72 of file fsc_RawMedVolCollector.h.

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

where to store files

Definition at line 75 of file fsc_RawMedVolCollector.h.

Referenced by ProcRecMedPosMgr().

each generation set this member

Definition at line 78 of file fsc_RawMedVolCollector.h.

Referenced by ProcRecGeneration(), and ProcRecMedPosMgr().

MedVolume file storage.

Definition at line 81 of file fsc_RawMedVolCollector.h.

Referenced by ProcRecMedPosMgr().

Definition at line 83 of file fsc_RawMedVolCollector.h.

Referenced by ProcRecMedPosMgr().

Definition at line 85 of file fsc_RawMedVolCollector.h.

Referenced by ProcRecCopy(), and ProcRecGeneration().


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

Generated on Mon Feb 27 19:24:05 2012 for OPENARCHIVE by  doxygen 1.5.6