fsc_VolumeCheck Class Reference
[File System Catalog]

#include <fsc_VolumeCheck.h>

Inheritance diagram for fsc_VolumeCheck:

Inheritance graph
[legend]
Collaboration diagram for fsc_VolumeCheck:

Collaboration graph
[legend]

List of all members.


Detailed Description

Definition at line 36 of file fsc_VolumeCheck.h.


Public Member Functions

 fsc_VolumeCheck (fsc_DataLMgr &a_dataLMgr, const cmn_Path &a_fscDirectory, const string &a_partitionName, const cmn_UUID_t &a_volumeID, ui_MsgWriter &a_msgWrite, ivd_MedVolNum_t a_medVolNum, ivd_MediaKey_t a_mediaKey, df_BlockProxy *a_reader, bool a_autoCorrect, bool a_removeMissingOnMedia, ivd_MediaChkStat_t &a_checkStat, UInt32_t a_lastDataPosition=0)
virtual ~fsc_VolumeCheck ()

Public Attributes

 log_CLASSID_m
 Macro to add class name member s_className.

Private Member Functions

virtual void ProcSplitInfo (df_SplitInfo *a_splitInfo)
 when one split info is parsed then call ProcSplitInfo()
void Check (df_SplitInfo &a_splitInfo)
void DisplayMessage (fsc_medVolData_t &a_mvd, fsc_nsElement *a_nsElement_p, df_SplitInfo &a_splitInfo, string &a_status, UInt32_t a_fieldStatus)
void DisplayMessage (df_SplitInfo &a_splitInfo, string &a_status)
fsc_medVolData_tFindMVD (df_SplitInfo &a_splitInfo)
void GetNextOfsSubBlock ()
void RestDataHandle ()

Private Attributes

fsc_DataLMgrm_dataLMgr
 to update FSC in case of split missing
fsc_medVolData_tm_sameOfsBlockBeg
 first entry of current offset
fsc_medVolData_tm_sameOfsBlockEnd
 next offset
fsc_medVolData_tm_buffEnd_p
 This is set by MedVolume class NOTE: fsc_VolumeCheck modify buffer to know which rec was already handled fileID is modified field and is set to 0 after use.
ivd_BlockOffset_t m_currentBlockOffset
 from which block offset are data in m_volData_v
string m_partitionName
 check output file name is constructed with partitionName
fsc_MedVolReader m_medVolRead
 media volume reader, reads prepared file by FSC NOTE: this class modify buffer got from m_medVolRead
ui_MsgWriterm_msgWrite
 writes mismatch to client output
bool m_autoCorrect
 if set then add missing split to FSC
bool m_removeMissingOnMedia
 if set then remove splits from FSC that missing on media
ivd_MediaChkStat_tm_checkStat
 statistic collection recod

Constructor & Destructor Documentation

fsc_VolumeCheck::fsc_VolumeCheck ( fsc_DataLMgr a_dataLMgr,
const cmn_Path a_fscDirectory,
const string &  a_partitionName,
const cmn_UUID_t a_volumeID,
ui_MsgWriter a_msgWrite,
ivd_MedVolNum_t  a_medVolNum,
ivd_MediaKey_t  a_mediaKey,
df_BlockProxy a_reader,
bool  a_autoCorrect,
bool  a_removeMissingOnMedia,
ivd_MediaChkStat_t a_checkStat,
UInt32_t  a_lastDataPosition = 0 
)

Definition at line 40 of file fsc_VolumeCheck.cpp.

References dbg_DETAIL, GetNextOfsSubBlock(), log_DBG_m, log_FUNC_m, m_buffEnd_p, m_sameOfsBlockBeg, m_sameOfsBlockEnd, and NULL.

00053     :
00054     df_SplitInfoUnpacker(a_medVolNum,
00055                          a_mediaKey,
00056                          a_reader,
00057                          false,
00058                          a_lastDataPosition,
00059                          a_volumeID),
00060     m_dataLMgr(a_dataLMgr),
00061 //    m_trans(a_trans),
00062 //    m_sameOfsBlockBeg(NULL),
00063 //    m_sameOfsBlockEnd(NULL), // set by m_medVolRead constructor
00064 //    m_buffEnd_p(NULL),
00065     m_currentBlockOffset(0),
00066     m_partitionName(a_partitionName),
00067     m_medVolRead(a_fscDirectory,  // can throw ivd_Error if no file found
00068                  a_mediaKey,
00069                  a_medVolNum,
00070                  m_sameOfsBlockBeg,
00071                  m_buffEnd_p,
00072                  true), // clear volume directory after use
00073     m_msgWrite(a_msgWrite),
00074     m_autoCorrect(a_autoCorrect),
00075     m_removeMissingOnMedia(a_removeMissingOnMedia),
00076     m_checkStat(a_checkStat)
00077 {
00078     log_FUNC_m(fsc_VolumeCheck);
00079     // m_sameOfsBlockEnd point to the end of the current block
00080     // at start point to first element
00081     m_sameOfsBlockEnd = m_sameOfsBlockBeg;
00082     log_DBG_m(dbg_DETAIL,  "Buff : m_sameOfsBlockEnd =" << hex << m_sameOfsBlockEnd
00083                       <<  " m_buffEnd_p =" << hex << m_buffEnd_p << dec);
00084     // prepare first m_currentBlockOffset and its sub block range
00085     if (m_sameOfsBlockEnd == NULL) {
00086         GetNextOfsSubBlock();
00087     }
00088 }
//============================================================================//

Here is the call graph for this function:

fsc_VolumeCheck::~fsc_VolumeCheck (  )  [virtual]

Definition at line 91 of file fsc_VolumeCheck.cpp.

References GetNextOfsSubBlock(), log_FUNC_m, m_sameOfsBlockEnd, and NULL.

00091                                   {
00092     log_FUNC_m(~fsc_VolumeCheck);
00093     while (m_sameOfsBlockEnd != NULL
00094           && !uncaught_exception()) {
00095         GetNextOfsSubBlock();
00096     }
00097 }

Here is the call graph for this function:


Member Function Documentation

void fsc_VolumeCheck::ProcSplitInfo ( df_SplitInfo a_splitInfo  )  [private, virtual]

when one split info is parsed then call ProcSplitInfo()

Reimplemented from df_SplitInfoUnpacker.

Definition at line 100 of file fsc_VolumeCheck.cpp.

References Check(), log_FUNC_m, and NULL.

00100                                                              {
00101     log_FUNC_m(ProcSplitInfo);
00102 
00103     if (a_splitInfo != NULL) {
00104         Check(*a_splitInfo);
00105     }
00106     else {
00107   //      cout << "End of stream." << endl;
00108     }
00109 }

Here is the call graph for this function:

void fsc_VolumeCheck::Check ( df_SplitInfo a_splitInfo  )  [private]

Definition at line 112 of file fsc_VolumeCheck.cpp.

References ivd_MediaChkStat_t::addToFSC, df_SplitInfo::blockOffset, ivd_MediaChkStat_t::checked, fsc_nsElement::CheckLastGen(), ivd_MediaChkStat_t::correctedNSC, fsc_medVolData_t::dataSize, fsc_medVolData_t::dataType, df_SplitInfo::dataType, dbg_DETAIL, DisplayMessage(), fsc_medVolData_t::fileID, df_SplitInfo::fileID, df_SplitInfo::fileType, FindMVD(), fmm_MIGFLAGS, fmm_MIGSIZE, fmm_OK, fmm_SPLITOFFSET, fmm_SPLITSIZE, fsc_nsCreateElementObj(), fsc_nsRemoveElementObj(), g_updateNSC, ie_FSC_NONSCELEMENTOBJ, ift_DIR, fsc_DataLMgr::Insert(), fsc_Split::IsZeroSizeSplit(), ivd_ATTR_d, ivd_DATA_d, df_SplitInfo::lastSplit, log_DBG_m, log_FUNC_m, log_MSG_m, log_WARNING, m_autoCorrect, m_checkStat, m_dataLMgr, df_SplitInfo::mediaKey, df_SplitInfo::medVolNum, ivd_MediaChkStat_t::mismatch, fsc_medVolData_t::MismatchDump(), ivd_MediaChkStat_t::missingInFSC, mvds_LASTGENERATION, mvds_NONSC, ivd_MediaChkStat_t::noNSC, NULL, fsc_DataLMgr::Remove(), fsc_medVolData_t::splitOffset, df_SplitInfo::splitOffset, fsc_medVolData_t::splitSize, df_SplitInfo::splitSize, and fsc_medVolData_t::status.

Referenced by ProcSplitInfo().

00112                                                      {
00113     log_FUNC_m(Check);
00114     // find particular fsc_medVolData_t
00115     UInt32_t fieldStatus = fmm_OK;
00116 
00117     m_checkStat.checked++;
00118 
00119     bool zeroSplit;
00120 
00121     {
00122         fsc_Split fscSplit(a_splitInfo);
00123         zeroSplit = fscSplit.IsZeroSizeSplit();
00124     }
00125 
00126     fsc_medVolData_t *mvd = FindMVD(a_splitInfo);
00127     if (mvd == NULL) {
00128         // not in FSC
00129         string statusTxt;
00130 
00131         if (zeroSplit) {
00132             return;
00133         }
00134         if (m_autoCorrect) {
00135             m_dataLMgr.Insert(a_splitInfo);
00136             statusTxt = "    Missing in FSC. [CORRECTED] ";
00137             m_checkStat.addToFSC++;
00138         }
00139         else {
00140             statusTxt = "    Missing in FSC.";
00141             m_checkStat.missingInFSC++;
00142         }
00143         DisplayMessage(a_splitInfo,
00144                        statusTxt);
00145         return;
00146     }
00147 
00148     if (zeroSplit) {
00149         string statusTxt;
00150         if (m_autoCorrect) {
00151             m_dataLMgr.Remove(a_splitInfo.fileID,
00152                               a_splitInfo.mediaKey,
00153                               a_splitInfo.medVolNum,
00154                               a_splitInfo.blockOffset);
00155             statusTxt = "    Found entry for zero split size in FSC. [CORRECTED] ";
00156             DisplayMessage(a_splitInfo,
00157                            statusTxt);
00158         }
00159         else {
00160             ostringstream msg;
00161             msg << "Found entry for zero size split in FSC. "
00162                 << "Run check with autocorrect option to correct this entry.";
00163             log_MSG_m(log_WARNING, 0,  msg.str());
00164         }
00165     }
00166 
00167     log_DBG_m(dbg_DETAIL,  mvd->MismatchDump());
00168 
00169     bool fscUpdateNeeded(false);
00170 
00171     if (   a_splitInfo.lastSplit  //
00172         && ((a_splitInfo.dataType & ivd_DATA_d) == ivd_DATA_d)  // not only header migratted
00173         && a_splitInfo.fileType != ift_DIR // not a directory
00174         && mvd->dataSize != (UInt64_t)a_splitInfo.splitOffset + a_splitInfo.splitSize) {
00175         fieldStatus |= fmm_MIGSIZE;
00176         fscUpdateNeeded = true;
00177     }
00178     if (mvd->dataType != a_splitInfo.dataType) {
00179         fieldStatus |= fmm_MIGFLAGS;
00180         fscUpdateNeeded = true;
00181     }
00182     if (mvd->splitOffset != (UInt64_t)a_splitInfo.splitOffset) {
00183         fieldStatus |= fmm_SPLITOFFSET;
00184     }
00185     if (mvd->splitSize != (UInt64_t)a_splitInfo.splitSize
00186         && a_splitInfo.dataType != ivd_ATTR_d  // not only header migratted
00187         && a_splitInfo.fileType != ift_DIR) {
00188         fieldStatus |= fmm_SPLITSIZE;
00189         // dataType mismatch
00190     }
00191 
00192     if (m_autoCorrect && fscUpdateNeeded) {
00193         m_dataLMgr.Insert(a_splitInfo);
00194     }
00195 
00196 //    auto_ptr<fsc_nsElement> nsElement = NULL;
00197     fsc_nsElement *nsElement = NULL;
00198 
00199     string ret;
00200 
00201     if (g_updateNSC) {
00202         if (mvd->status & mvds_NONSC) {
00203             if (m_autoCorrect) {
00204                 m_dataLMgr.Insert(a_splitInfo);
00205                 ret = "    No NSC. [CORRECTED]";
00206                 m_checkStat.correctedNSC++;
00207             }
00208             else {
00209                 m_checkStat.noNSC++;
00210                 ret = "    No NSC.";
00211             }
00212         }
00213         else if (mvd->status & mvds_LASTGENERATION) {
00214             nsElement = fsc_nsCreateElementObj(a_splitInfo.fileID,
00215                                                a_splitInfo.fileType == ift_DIR);
00216             if (nsElement != NULL) {
00217                 nsElement->CheckLastGen(ret, a_splitInfo, m_autoCorrect, fieldStatus);
00218             }
00219             else {
00220                 throw ivd_InternalError(ie_FSC_NONSCELEMENTOBJ, "", true);
00221             }
00222         }
00223 //        CheckNSC(a_splitInfo, mvd->status, fieldStatus);
00224     }
00225 
00226     if (fieldStatus || !ret.empty()) {
00227         m_checkStat.mismatch++;
00228         DisplayMessage(*mvd,
00229                        nsElement,
00230                        a_splitInfo,
00231                        ret,
00232                        fieldStatus);
00233     }
00234 
00235     if (nsElement != NULL) {
00236         fsc_nsRemoveElementObj(nsElement);
00237     }
00238     mvd->fileID = 0; // set to 0 to mark already handled
00239 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fsc_VolumeCheck::DisplayMessage ( fsc_medVolData_t a_mvd,
fsc_nsElement a_nsElement_p,
df_SplitInfo a_splitInfo,
string &  a_status,
UInt32_t  a_fieldStatus 
) [private]

Definition at line 242 of file fsc_VolumeCheck.cpp.

References df_SplitInfo::blockOffset, fsc_medVolData_t::blockOffset, cmn_GetMigFlags(), cmn_Num2Str(), df_SplitInfo::continueSplit, fsc_medVolData_t::dataSize, df_SplitInfo::dataType, fsc_medVolData_t::dataType, ui_MsgWriter::DisplayMessage(), df_SplitInfo::fileID, df_SplitInfo::fileName, df_SplitInfo::fileSize, df_SplitInfo::fileType, fmm_FILENAME, fmm_FILESIZE, fmm_MEDVOLOFFSET, fmm_MIGFLAGS, fmm_MIGID, fmm_MIGSIZE, fmm_SPLITFLAGS, fmm_SPLITOFFSET, fmm_SPLITSIZE, fsc_MissmatchTxt_d, fsc_nsElement::GetStandAttrPtr(), df_SplitInfo::lastSplit, m_autoCorrect, m_msgWrite, df_SplitInfo::mediaKey, df_SplitInfo::medVolNum, fsc_medVolData_t::migrationID, df_SplitInfo::migrationID, ntoh(), NULL, df_SplitInfo::oldFileName, df_SplitInfo::oldOwnerID, df_SplitInfo::ownerID, df_StandardAttr_t::size, fsc_medVolData_t::splitOffset, df_SplitInfo::splitOffset, fsc_medVolData_t::splitSize, df_SplitInfo::splitSize, and fsc_medVolData_t::status.

Referenced by Check().

00246                                                                         {
00247     string friDataSizeStr;
00248     if (a_splitInfo.lastSplit) {
00249         friDataSizeStr = cmn_Num2Str(a_splitInfo.splitOffset + a_splitInfo.splitSize);
00250     }
00251     else {
00252         friDataSizeStr = "n/a";
00253     }
00254 
00255     string fscFileSizeStr = "n/a";
00256     if (a_nsElement_p != NULL) {
00257         df_StandardAttr_t* standAttr_p = a_nsElement_p->GetStandAttrPtr();
00258         if (standAttr_p != NULL) {
00259             fscFileSizeStr = cmn_Num2Str(ntoh(standAttr_p->size));
00260         }
00261     }
00262 
00263 
00264     string splitFlag;
00265     if (a_splitInfo.continueSplit) {
00266         splitFlag = 'C';
00267     }
00268     if (a_splitInfo.lastSplit) {
00269         splitFlag += 'L';
00270     }
00271 
00272     ostringstream sstr;
00273     sstr << a_splitInfo.fileID << " "
00274         << a_splitInfo.migrationID << " "
00275         << a_splitInfo.fileName << endl
00276         << a_status << endl
00277         << "    DUMP:                     FSC             FRI Notes" << endl;
00278 
00279     sstr << "    MigID        " << setw(16) << a_mvd.migrationID
00280             << setw(16) << a_splitInfo.migrationID
00281             << fsc_MissmatchTxt_d(a_fieldStatus & fmm_MIGID);
00282 
00283     sstr << "    MediaKey     " << setw(16) << "n/a" << setw(16) << a_splitInfo.mediaKey << endl;
00284 
00285     sstr << "    MedVolNum    " << setw(16) << "n/a" << setw(16) << a_splitInfo.medVolNum << endl;
00286 
00287     sstr << "    MedVolOffset " << setw(16) << a_mvd.blockOffset << setw(16) << a_splitInfo.blockOffset
00288             << fsc_MissmatchTxt_d(a_fieldStatus & fmm_MEDVOLOFFSET);
00289 
00290     sstr << "    FileType     " << setw(16) << "n/a" << setw(16) << a_splitInfo.fileType << endl;
00291 
00292     sstr << "    FileSize     " << setw(16) << fscFileSizeStr << setw(16) << a_splitInfo.fileSize
00293             << fsc_MissmatchTxt_d(a_fieldStatus & fmm_FILESIZE);
00294 
00295     sstr << "    MigSize      " << setw(16) << a_mvd.dataSize << setw(16) << friDataSizeStr
00296             << fsc_MissmatchTxt_d(a_fieldStatus & fmm_MIGSIZE);
00297 
00298     sstr << "    MigFlags     " << setw(16) << cmn_GetMigFlags((int)a_mvd.dataType)
00299             << setw(16) << cmn_GetMigFlags((int)a_splitInfo.dataType);
00300     if (a_fieldStatus & fmm_MIGFLAGS) {
00301         if (m_autoCorrect) {
00302             sstr << " MISMATCH [CORRECTED]\n";
00303         }
00304         else {
00305             sstr << " MISMATCH\n";
00306         }
00307     }
00308     else {
00309         sstr << "\n";
00310     }
00311 
00312     sstr << "    SplitFlags   " << setw(16) << "n/a" << setw(16) << splitFlag
00313             << fsc_MissmatchTxt_d(a_fieldStatus & fmm_SPLITFLAGS);
00314 
00315     sstr << "    SplitOffset  " << setw(16) << a_mvd.splitOffset << setw(16) << a_splitInfo.splitOffset
00316             << fsc_MissmatchTxt_d(a_fieldStatus & fmm_SPLITOFFSET);
00317 
00318     sstr << "    SplitSize    " << setw(16) << a_mvd.splitSize << setw(16) << a_splitInfo.splitSize
00319             << fsc_MissmatchTxt_d(a_fieldStatus & fmm_SPLITSIZE);
00320 
00321     sstr << "    FileName     " << setw(16) << "n/a" << " " << a_splitInfo.fileName
00322             << fsc_MissmatchTxt_d(a_fieldStatus & fmm_FILENAME);
00323 
00324 
00325     sstr << "    OldFileName  " << setw(16) << "n/a" << setw(16) << a_splitInfo.oldFileName << endl;
00326     sstr << "    OwnerID      " << setw(16) << "n/a" << setw(16) << a_splitInfo.ownerID << endl;
00327     sstr << "    OldOwnerID   " << setw(16) << "n/a" << setw(16) << a_splitInfo.oldOwnerID << endl;
00328     sstr << "    Status       " << setw(16) << a_mvd.status << setw(16) << "n/a" << endl;
00329 
00330     m_msgWrite.DisplayMessage(sstr.str().c_str());
00331 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fsc_VolumeCheck::DisplayMessage ( df_SplitInfo a_splitInfo,
string &  a_status 
) [private]

Definition at line 334 of file fsc_VolumeCheck.cpp.

References df_SplitInfo::blockOffset, cmn_GetMigFlags(), cmn_Num2Str(), df_SplitInfo::continueSplit, df_SplitInfo::dataType, ui_MsgWriter::DisplayMessage(), df_SplitInfo::fileID, df_SplitInfo::fileName, df_SplitInfo::fileSize, df_SplitInfo::fileType, df_SplitInfo::lastSplit, m_msgWrite, df_SplitInfo::mediaKey, df_SplitInfo::medVolNum, df_SplitInfo::migrationID, df_SplitInfo::oldFileName, df_SplitInfo::oldOwnerID, df_SplitInfo::ownerID, df_SplitInfo::splitOffset, and df_SplitInfo::splitSize.

00335                                                                     {
00336     string friDataSizeStr;
00337     if (a_splitInfo.lastSplit) {
00338         friDataSizeStr = cmn_Num2Str(a_splitInfo.splitOffset + a_splitInfo.splitSize);
00339     }
00340     else {
00341         friDataSizeStr = "n/a";
00342     }
00343 
00344     string splitFlag;
00345     if (a_splitInfo.continueSplit) {
00346         splitFlag = 'C';
00347     }
00348     if (a_splitInfo.lastSplit) {
00349         splitFlag += 'L';
00350     }
00351 
00352     ostringstream sstr;
00353     sstr << a_splitInfo.fileID << " "
00354         << a_splitInfo.migrationID << " "
00355         << a_splitInfo.fileName << endl
00356         << a_status << endl
00357         << "    DUMP:                     FRI" << endl;
00358 
00359     sstr << "    MigID        " << setw(16) << a_splitInfo.migrationID << endl;
00360 
00361     sstr << "    MediaKey     " << setw(16) << a_splitInfo.mediaKey << endl;
00362 
00363     sstr << "    MedVolNum    " << setw(16) << a_splitInfo.medVolNum << endl;
00364 
00365     sstr << "    MedVolOffset " << setw(16) << a_splitInfo.blockOffset << endl;
00366 
00367     sstr << "    FileType     " << setw(16) << a_splitInfo.fileType << endl;
00368 
00369     sstr << "    FileSize     " << setw(16) << a_splitInfo.fileSize << endl;
00370 
00371     sstr << "    MigSize      " << setw(16) << friDataSizeStr << endl;
00372 
00373     sstr << "    MigFlags     " << setw(16) << cmn_GetMigFlags((int)a_splitInfo.dataType) << endl;
00374 
00375     sstr << "    SplitFlags   " << setw(16) << splitFlag << endl;
00376 
00377     sstr << "    SplitOffset  " << setw(16) << a_splitInfo.splitOffset << endl;
00378 
00379     sstr << "    SplitSize    " << setw(16) << a_splitInfo.splitSize << endl;
00380 
00381     sstr << "    FileName     " << a_splitInfo.fileName << endl;
00382 
00383     sstr << "    OldFileName  " << setw(16) << a_splitInfo.oldFileName << endl;
00384     sstr << "    OwnerID      " << setw(16) << a_splitInfo.ownerID << endl;
00385     sstr << "    OldOwnerID   " << setw(16) << a_splitInfo.oldOwnerID << endl;
00386 
00387     m_msgWrite.DisplayMessage(sstr.str().c_str());
00388 }

Here is the call graph for this function:

fsc_medVolData_t * fsc_VolumeCheck::FindMVD ( df_SplitInfo a_splitInfo  )  [private]

Definition at line 391 of file fsc_VolumeCheck.cpp.

References df_SplitInfo::blockOffset, dbg_DETAIL, df_SplitInfo::fileID, GetNextOfsSubBlock(), log_DBG_m, log_FUNC_m, m_buffEnd_p, m_currentBlockOffset, m_sameOfsBlockBeg, m_sameOfsBlockEnd, df_SplitInfo::migrationID, and NULL.

Referenced by Check().

00391                                                                     {
00392     log_FUNC_m(FindMVD);
00393     log_DBG_m(dbg_DETAIL,  "m_sameOfsBlockEnd = " << m_sameOfsBlockEnd);
00394     if (m_sameOfsBlockEnd == NULL) {
00395         return NULL; // FSC has no more data for this volume
00396     }
00397     while (m_currentBlockOffset < a_splitInfo.blockOffset) {
00398         log_DBG_m(dbg_DETAIL,  "GetNextOfsSubBlock");
00399         GetNextOfsSubBlock();
00400         log_DBG_m(dbg_DETAIL,  "Next Buff : m_sameOfsBlockEnd =" << hex << m_sameOfsBlockEnd
00401                             << " m_buffEnd_p =" << hex << m_buffEnd_p << dec);
00402         if (m_sameOfsBlockEnd == NULL) {
00403             log_DBG_m(dbg_DETAIL,  "Block is empty");
00404            return NULL;
00405         }
00406     }
00407     if (m_currentBlockOffset != a_splitInfo.blockOffset) {
00408        log_DBG_m(dbg_DETAIL,  "m_currentBlockOffset != splitInfo.blockOffset "
00409                              <<  m_currentBlockOffset << " != " << a_splitInfo.blockOffset);
00410         return NULL; // split is not from same block,
00411     }
00412     log_DBG_m(dbg_DETAIL,  "Search in MedVolOfs block"
00413                         << "SI.fileID =" << a_splitInfo.fileID
00414                         << " SI.migID =" << a_splitInfo.migrationID);
00415     for (fsc_medVolData_t* iter = m_sameOfsBlockBeg;
00416          iter != m_sameOfsBlockEnd;
00417          ++iter) {
00418          log_DBG_m(dbg_DETAIL,  "fileID =" << iter->fileID
00419                              << " migID =" << iter->migrationID);
00420          if (//   mvd.blockOffset == a_splitInfo.blockOffset
00421              // &&
00422                 iter->fileID      == a_splitInfo.fileID
00423              && iter->migrationID == a_splitInfo.migrationID) {
00424              return iter;
00425          }
00426     }
00427     return NULL;
00428 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fsc_VolumeCheck::GetNextOfsSubBlock (  )  [private]

Definition at line 431 of file fsc_VolumeCheck.cpp.

References fsc_medVolData_t::blockOffset, dbg_DETAIL, fsc_MedVolReader::GetNextBuff(), log_DBG_m, log_FUNC_m, m_buffEnd_p, m_currentBlockOffset, m_medVolRead, m_sameOfsBlockBeg, m_sameOfsBlockEnd, NULL, and RestDataHandle().

Referenced by FindMVD(), fsc_VolumeCheck(), and ~fsc_VolumeCheck().

00431                                          {
00432     log_FUNC_m(GetNextOfsSubBlock);
00433     RestDataHandle();
00434     if (m_sameOfsBlockEnd == m_buffEnd_p) { // get new buffer
00435         // m_sameOfsBlockEnd point to first element when new buffer got
00436        m_medVolRead.GetNextBuff(m_sameOfsBlockEnd, m_buffEnd_p);
00437        log_DBG_m(dbg_DETAIL,  "Next Buff : m_sameOfsBlockEnd =" << hex << m_sameOfsBlockEnd
00438                           <<  " m_buffEnd_p =" << hex << m_buffEnd_p << dec);
00439        if (m_sameOfsBlockEnd == NULL) {
00440            return; // no more data
00441        }
00442     }
00443     m_sameOfsBlockBeg    = m_sameOfsBlockEnd;
00444     m_currentBlockOffset = m_sameOfsBlockBeg->blockOffset;
00445     log_DBG_m(dbg_DETAIL,  "m_currentBlockOffset =" << m_currentBlockOffset);
00446     while (++m_sameOfsBlockEnd != m_buffEnd_p
00447            && m_sameOfsBlockEnd->blockOffset == m_currentBlockOffset) {
00448         // empty
00449     }
00450 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fsc_VolumeCheck::RestDataHandle (  )  [private]

Definition at line 453 of file fsc_VolumeCheck.cpp.

References ui_MsgWriter::DisplayMessage(), df_SplitInfoUnpacker::GetMediumKey(), df_SplitInfoUnpacker::GetMedVolNum(), log_FUNC_m, m_checkStat, m_dataLMgr, m_msgWrite, m_removeMissingOnMedia, m_sameOfsBlockBeg, m_sameOfsBlockEnd, ivd_MediaChkStat_t::missingOnMedia, and fsc_DataLMgr::Remove().

Referenced by GetNextOfsSubBlock().

00453                                      {
00454     log_FUNC_m(RestDataHandle);
00455 
00456     for (fsc_medVolData_t* iter = m_sameOfsBlockBeg;
00457          iter != m_sameOfsBlockEnd;
00458          ++iter) {
00459         // handled splits has fileID = 0
00460         if (iter->fileID != 0) {
00461             // split in FSC but not on volume
00462             // this entries has no its presence on volume
00463 
00464             ostringstream sstr;
00465             sstr << (*iter).fileID << " "
00466                 << (*iter).migrationID << " " << endl
00467                 << "    Missing on volume.";
00468 
00469             if (m_removeMissingOnMedia) {
00470                 if (m_dataLMgr.Remove(iter->fileID,
00471                                   GetMediumKey(),
00472                                   GetMedVolNum(),
00473                                   iter->blockOffset)) {
00474                     sstr << " [REMOVED from FSC]";
00475                 }
00476                 else {
00477                     sstr << " [REMOVE FAILED]";
00478                     m_checkStat.missingOnMedia++;
00479                 }
00480             }
00481             else {
00482                 m_checkStat.missingOnMedia++;
00483             }
00484 
00485             sstr << endl
00486                 << "    DUMP:      FSC"
00487                 << (*iter).MismatchDump();
00488             m_msgWrite.DisplayMessage(sstr.str());
00489         }
00490     }
00491 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

to update FSC in case of split missing

Definition at line 56 of file fsc_VolumeCheck.h.

Referenced by Check(), and RestDataHandle().

first entry of current offset

Definition at line 60 of file fsc_VolumeCheck.h.

Referenced by FindMVD(), fsc_VolumeCheck(), GetNextOfsSubBlock(), and RestDataHandle().

next offset

Definition at line 62 of file fsc_VolumeCheck.h.

Referenced by FindMVD(), fsc_VolumeCheck(), GetNextOfsSubBlock(), RestDataHandle(), and ~fsc_VolumeCheck().

This is set by MedVolume class NOTE: fsc_VolumeCheck modify buffer to know which rec was already handled fileID is modified field and is set to 0 after use.

Definition at line 69 of file fsc_VolumeCheck.h.

Referenced by FindMVD(), fsc_VolumeCheck(), and GetNextOfsSubBlock().

from which block offset are data in m_volData_v

Definition at line 72 of file fsc_VolumeCheck.h.

Referenced by FindMVD(), and GetNextOfsSubBlock().

check output file name is constructed with partitionName

Definition at line 75 of file fsc_VolumeCheck.h.

media volume reader, reads prepared file by FSC NOTE: this class modify buffer got from m_medVolRead

Definition at line 79 of file fsc_VolumeCheck.h.

Referenced by GetNextOfsSubBlock().

writes mismatch to client output

Definition at line 82 of file fsc_VolumeCheck.h.

Referenced by DisplayMessage(), and RestDataHandle().

if set then add missing split to FSC

Definition at line 85 of file fsc_VolumeCheck.h.

Referenced by Check(), and DisplayMessage().

if set then remove splits from FSC that missing on media

Definition at line 88 of file fsc_VolumeCheck.h.

Referenced by RestDataHandle().

statistic collection recod

Definition at line 91 of file fsc_VolumeCheck.h.

Referenced by Check(), and RestDataHandle().

Macro to add class name member s_className.

Reimplemented from df_SplitInfoUnpacker.

Definition at line 95 of file fsc_VolumeCheck.h.


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

Generated on Mon Feb 27 19:25:12 2012 for OPENARCHIVE by  doxygen 1.5.6