FileInfoCache Class Reference
[Classes for managing events]

#include <treewalk.h>

Collaboration diagram for FileInfoCache:

Collaboration graph
[legend]

List of all members.


Detailed Description

Definition at line 78 of file treewalk.h.


Public Member Functions

 FileInfoCache (ui_MsgWriter &a_msgWrite, int a_numFilesPerBatch, UInt32_t a_sysLoadPct, UInt64_t &a_missingCount, UInt64_t &a_missingCopyCount, UInt64_t &a_ownerMismatchCount)
bool AddFile (const FileInfo &a_fileInfoVecEl)
void CheckFiles ()

Public Attributes

 log_CLASSID_m

Private Attributes

vector< FileInfom_fileInfos
unsigned int m_numFilesPerBatch
ui_MsgWriterm_msgWrite
UInt64_tm_missingCount
 reference on TreeWalk member
UInt64_tm_missingCopyCount
UInt64_tm_ownerMismatchCount

Constructor & Destructor Documentation

FileInfoCache::FileInfoCache ( ui_MsgWriter a_msgWrite,
int  a_numFilesPerBatch,
UInt32_t  a_sysLoadPct,
UInt64_t a_missingCount,
UInt64_t a_missingCopyCount,
UInt64_t a_ownerMismatchCount 
)

Definition at line 42 of file treewalk.cpp.

References log_FUNC_m, and m_fileInfos.

00049     :
00050     m_fileInfos(),
00051     m_numFilesPerBatch(a_numFilesPerBatch),
00052     m_msgWrite(a_msgWrite),
00053     m_missingCount(a_missingCount),
00054     m_missingCopyCount(a_missingCopyCount),
00055     m_ownerMismatchCount(a_ownerMismatchCount)
00056 {
00057     log_FUNC_m(FileInfoCache);
00058     m_fileInfos.reserve(a_numFilesPerBatch);
00059 }
//============================================================================//


Member Function Documentation

bool FileInfoCache::AddFile ( const FileInfo a_fileInfoVecEl  ) 

Definition at line 63 of file treewalk.cpp.

References CheckFiles(), dbg_DETAIL, log_DBG_m, log_FUNC_m, FileInfo::m_dirPath, FileInfo::m_fileID, m_fileInfos, FileInfo::m_name, m_numFilesPerBatch, and FileInfo::m_ownerID.

Referenced by TreeWalk::CheckDir().

00063                                                            {
00064     log_FUNC_m(AddFile);
00065     log_DBG_m(dbg_DETAIL,  "Add file " << a_fileInfoVecEl.m_dirPath + a_fileInfoVecEl.m_name
00066                             << ", inode: " << a_fileInfoVecEl.m_fileID 
00067                             << ", owner " << a_fileInfoVecEl.m_ownerID);
00068 
00069     m_fileInfos.push_back(a_fileInfoVecEl);
00070     if (m_fileInfos.size() >= m_numFilesPerBatch) {
00071         CheckFiles();
00072         return true;
00073     }
00074     return false;
00075 }

Here is the call graph for this function:

Here is the caller graph for this function:

void FileInfoCache::CheckFiles (  ) 

Definition at line 79 of file treewalk.cpp.

References i_FSCfileState_t::arrayIdx, i_FSCNumCopVsNumPoolsCheckStatus_t::changed, i_FSCNumCopVsNumPoolsCheckStatus_t::copiesExpected, i_FSCNumCopVsNumPoolsCheckStatus_t::copiesFound, dbg_DETAIL, ui_MsgWriter::DisplayMessage(), i_IvdfsFileInfo_t::fileID, i_IvdfsFileInfo_t::fileName, i_IvdfsFileInfo_t::fileSize, i_FSCfileState_t::fileState, i_FSCfileState_t::fscNumCopVsNumPoolsCheckStatus, g_iFSC, ipc_EXEC_m, log_DBG_m, log_FUNC_m, FileInfo::m_dirPath, FileInfo::m_fileID, m_fileInfos, m_missingCopyCount, m_missingCount, m_msgWrite, FileInfo::m_name, m_ownerMismatchCount, i_FSCfileState_t::migrationID, i_IvdfsFileInfo_t::ownerID, i_FSCfileState_t::ownerMismatch, i_FSCNumCopVsNumPoolsCheckStatus_t::splitInWrongPool, and i_FSCNumCopVsNumPoolsCheckStatus_t::tooMuchCopiesPerPool.

Referenced by AddFile(), TreeWalk::CheckDir(), and TreeWalk::~TreeWalk().

00079                                {
00080     log_FUNC_m(CheckFiles);
00081 
00082     if (m_fileInfos.size() == 0) {
00083         log_DBG_m(dbg_DETAIL,  " No files to check in FSC.");
00084         return;
00085     }
00086 
00087     log_DBG_m(dbg_DETAIL,  " Check files in FSC. batch size " << m_fileInfos.size());
00088     
00089     const UInt32_t maxOutputs = 100;
00090     unsigned int i = 0;
00091 
00092     i_IvdfsFileInfo_v_t seqTFileInfo(m_fileInfos.size());
00093     seqTFileInfo.length(m_fileInfos.size());
00094     for(vector<FileInfo>::const_iterator iter = m_fileInfos.begin();
00095         iter != m_fileInfos.end(); ++iter, ++i) {
00096         i_IvdfsFileInfo_t &iFileInfo = seqTFileInfo[i];
00097         iFileInfo.fileID   = iter->m_fileID;
00098         iFileInfo.fileSize = iter->m_size;
00099         iFileInfo.ownerID  = iter->m_ownerID;
00100         iFileInfo.fileName = CORBA::string_dup(iter->m_name.c_str());
00101     }
00102     i_FSCfileState_v_t_var fscFileState;
00103     ipc_EXEC_m (
00104         fscFileState = g_iFSC->CheckWithIVDFS(seqTFileInfo);
00105     )
00106     for (i = 0; i < fscFileState->length(); ++i) {
00107         i_FSCfileState_t &fscFI = fscFileState[i];
00108         FileInfo &fi = m_fileInfos[fscFI.arrayIdx];
00109         ostringstream sstrs;
00110         if (fscFI.fscNumCopVsNumPoolsCheckStatus.changed) {
00111             if (m_missingCopyCount < maxOutputs) {
00112                 sstrs << fi.m_fileID << " "
00113                     << fscFI.migrationID << " "
00114                     << fi.m_dirPath + fi.m_name << endl;
00115 
00116                 if (fscFI.fscNumCopVsNumPoolsCheckStatus.splitInWrongPool) {
00117                     sstrs << "File has splits in different pools!" << endl;
00118                 }
00119 
00120                 if (fscFI.fscNumCopVsNumPoolsCheckStatus.tooMuchCopiesPerPool) {
00121                     sstrs << "File has more than 2 copies per pool!" << endl;
00122                 }
00123 
00124                 if (fscFI.fscNumCopVsNumPoolsCheckStatus.copiesFound != fscFI.fscNumCopVsNumPoolsCheckStatus.copiesExpected) {
00125                     sstrs << "Copies found: " << fscFI.fscNumCopVsNumPoolsCheckStatus.copiesFound << ", ";
00126                     sstrs << "Copies expected: " << fscFI.fscNumCopVsNumPoolsCheckStatus.copiesExpected << "!" << endl;
00127                 }
00128 
00129                 m_msgWrite.DisplayMessage(sstrs.str().c_str());
00130             }
00131             ++m_missingCopyCount;
00132         }
00133         else if (fscFI.ownerMismatch){
00134             sstrs << fi.m_fileID << " "
00135                 << fscFI.migrationID << " "
00136                 << fi.m_dirPath + fi.m_name << endl << fscFI.fileState;
00137 
00138             m_msgWrite.DisplayMessage(sstrs.str().c_str());
00139             ++m_ownerMismatchCount;
00140         }
00141         else {
00142             sstrs << fi.m_fileID << " "
00143                 << fscFI.migrationID << " "
00144                 << fi.m_dirPath + fi.m_name << endl << fscFI.fileState;
00145 
00146             ++m_missingCount;
00147             m_msgWrite.DisplayMessage(sstrs.str().c_str());
00148         }
00149         
00150     }
00151     m_fileInfos.clear();
00152 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 93 of file treewalk.h.

Definition at line 97 of file treewalk.h.

Referenced by AddFile(), CheckFiles(), and FileInfoCache().

unsigned int FileInfoCache::m_numFilesPerBatch [private]

Definition at line 98 of file treewalk.h.

Referenced by AddFile().

Definition at line 99 of file treewalk.h.

Referenced by CheckFiles().

reference on TreeWalk member

Definition at line 102 of file treewalk.h.

Referenced by CheckFiles().

Definition at line 103 of file treewalk.h.

Referenced by CheckFiles().

Definition at line 104 of file treewalk.h.

Referenced by CheckFiles().


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

Generated on Mon Feb 27 19:14:04 2012 for OPENARCHIVE by  doxygen 1.5.6