#include <fsc_RawMedVolCollector.h>


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 |
| 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 } //============================================================================//

| 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 }
| 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 }

| bool fsc_RawMedVolCollector::ProcRecGeneration | ( | fsc_Generation_t & | a_gen, | |
| UInt32_t | a_status | |||
| ) | [virtual] |
this method is called by fsc_Generation objekt to collect GenID and Size
Reimplemented from fsc_RawCollector.
Definition at line 68 of file fsc_RawMedVolCollector.cpp.
References fsc_medVolData_t::dataSize, fsc_NextEntity_t::dataType, fsc_medVolData_t::dataType, m_copyCounter, m_dataType, m_medVolData, fsc_Generation_t::migrationID, fsc_medVolData_t::migrationID, fsc_Generation_t::nextEntity, fsc_Generation_t::size, fsc_medVolData_t::splitOffset, fsc_medVolData_t::splitSize, and fsc_medVolData_t::status.
00069 { 00070 // log_FUNC_m(ProcRecGeneration); 00071 m_medVolData.migrationID = a_gen.migrationID; 00072 m_medVolData.dataSize = a_gen.size; 00073 m_medVolData.splitOffset = 0; 00074 m_medVolData.splitSize = a_gen.size; 00075 m_medVolData.dataType = m_dataType = a_gen.nextEntity.dataType; 00076 m_medVolData.status = a_status; 00077 m_copyCounter = 0; 00078 return true; 00079 }
| 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 }

| UInt32_t fsc_RawMedVolCollector::GetSplitCounter | ( | ) | [inline] |
to collect each split info
Definition at line 72 of file fsc_RawMedVolCollector.h.
Referenced by ProcFileID(), ProcRecCopy(), ProcRecGeneration(), ProcRecMedPosMgr(), and ProcRecSplit().
const cmn_Path fsc_RawMedVolCollector::m_fscDirectory [private] |
where to store files
Definition at line 75 of file fsc_RawMedVolCollector.h.
Referenced by ProcRecMedPosMgr().
UInt8_t fsc_RawMedVolCollector::m_dataType [private] |
each generation set this member
Definition at line 78 of file fsc_RawMedVolCollector.h.
Referenced by ProcRecGeneration(), and ProcRecMedPosMgr().
stx_Cache fsc_RawMedVolCollector::m_cache [private] |
MedVolume file storage.
Definition at line 81 of file fsc_RawMedVolCollector.h.
Referenced by ProcRecMedPosMgr().
Definition at line 85 of file fsc_RawMedVolCollector.h.
Referenced by ProcRecCopy(), and ProcRecGeneration().
1.5.6