fsc_FLSPerVolume Class Reference
[G_new_group]

#include <fsc_FLSPerVolume.h>

List of all members.


Detailed Description

Definition at line 33 of file fsc_FLSPerVolume.h.


Public Member Functions

 fsc_FLSPerVolume (ivd_MedVolNum_t a_volNum)
 fsc_FLSPerVolume (ivd_MedVolNum_t a_volNum, ivd_FileLocationData_t_v_i a_begin, ivd_FileLocationData_t_v_i a_end)
 fsc_FLSPerVolume (string &a_partName, ivd_MediaKey_t a_mediaKey, ivd_MedVolNum_t a_volNum)
 fsc_FLSPerVolume (ivd_MediaKey_t a_mediaKey, ivd_MedVolNum_t a_volNum)
 ~fsc_FLSPerVolume (void)
void Insert (ivd_FileLocationData_t &a_fileLoc)
 Impossible to inser new element after sort and cut.
void SortByOffset ()
ivd_FileLocationData_t_v_tGetRefOfFileLocDataVec ()
i_FileLocationDataList_tGetNextRecallList (UInt64_t a_buffSize)
i_RecallList_tGetCurrentRecallList ()
UInt64_t GetCurrentSplitSize ()
UInt64_t GetRemainingBytesToCopy ()
bool AtEndOfList ()
ivd_MedVolNum_t GetVolNum ()
void DumpFileListVector ()
void DumpFileListVector (ivd_FileLocationData_t_v_i a_begin, ivd_FileLocationData_t_v_i a_end)

Private Member Functions

UInt64_t CountVolumeSize ()

Private Attributes

 log_CLASSID_m
const ivd_MedVolNum_t m_volNum
ivd_FileLocationData_t_v_t m_fileLoc_v
ivd_FileLocationData_t_v_i m_recallSetEnd
ivd_FileLocationData_t_v_i m_recallSetBegin
UInt64_t m_remainingSplitSize
bool m_sorted

Constructor & Destructor Documentation

fsc_FLSPerVolume::fsc_FLSPerVolume ( ivd_MedVolNum_t  a_volNum  ) 

Definition at line 42 of file fsc_FLSPerVolume.cpp.

References log_FUNC_A_m.

00043     :
00044     m_volNum(a_volNum),
00045     m_remainingSplitSize(0),
00046     m_sorted(false)
00047 {
00048     log_FUNC_A_m(fsc_FLSPerVolume, "volNum: " << a_volNum);
00049 
00050 }
//============================================================================//

fsc_FLSPerVolume::fsc_FLSPerVolume ( ivd_MedVolNum_t  a_volNum,
ivd_FileLocationData_t_v_i  a_begin,
ivd_FileLocationData_t_v_i  a_end 
)

Definition at line 53 of file fsc_FLSPerVolume.cpp.

References CountVolumeSize(), log_FUNC_m, m_fileLoc_v, m_recallSetBegin, m_recallSetEnd, and m_remainingSplitSize.

00056     :
00057     m_volNum(a_volNum),
00058     m_sorted(true)
00059 {
00060     log_FUNC_m(fsc_FLSPerVolume assign);
00061     m_fileLoc_v.assign(a_begin, a_end);
00062     m_recallSetEnd = m_fileLoc_v.begin();
00063     m_recallSetBegin = m_fileLoc_v.begin();
00064     m_remainingSplitSize = CountVolumeSize();
00065 }
//============================================================================//

Here is the call graph for this function:

fsc_FLSPerVolume::fsc_FLSPerVolume ( string &  a_partName,
ivd_MediaKey_t  a_mediaKey,
ivd_MedVolNum_t  a_volNum 
)

Definition at line 68 of file fsc_FLSPerVolume.cpp.

References CountVolumeSize(), log_FUNC_A_m, m_fileLoc_v, m_recallSetBegin, m_recallSetEnd, m_remainingSplitSize, and fsc_DataCollectorStorage::ReadContent().

00071     :
00072     m_volNum(a_volNum),
00073     m_sorted(false)
00074 {
00075     log_FUNC_A_m(fsc_FLSPerVolume,
00076         "partName: " << a_partName <<
00077         ", medKey: " << a_mediaKey <<
00078         ", volNum: " << a_volNum);
00079 
00080     fsc_ReorgScanReorgVolStorage fileLocation(0, a_partName, a_mediaKey, a_volNum, false);
00081 
00082     fileLocation.ReadContent(m_fileLoc_v);
00083 
00084     m_recallSetEnd = m_fileLoc_v.begin();
00085     m_recallSetBegin = m_fileLoc_v.begin();
00086     m_remainingSplitSize = CountVolumeSize();
00087 }
//============================================================================//

Here is the call graph for this function:

fsc_FLSPerVolume::fsc_FLSPerVolume ( ivd_MediaKey_t  a_mediaKey,
ivd_MedVolNum_t  a_volNum 
)

Definition at line 90 of file fsc_FLSPerVolume.cpp.

References CountVolumeSize(), dbg_DETAIL, cmn_File::DeleteFile(), fsc_GetRedunCopyDir(), fsc_GetRedunCopyMedVolFile(), ivd_BaseException::GetFriendly(), log_DBG_m, log_FUNC_A_m, m_fileLoc_v, m_recallSetBegin, m_recallSetEnd, m_remainingSplitSize, and fsc_DataCollectorStorage::ReadContent().

00092     :
00093     m_volNum(a_volNum),
00094     m_sorted(false)
00095 {
00096     log_FUNC_A_m(fsc_FLSPerVolume,
00097         "medKey: " << a_mediaKey <<
00098         ", volNum: " << a_volNum);
00099     {
00100         fsc_RedunCopyDataVolStorageReader fileLocation(a_mediaKey, a_volNum);
00101 
00102         fileLocation.ReadContent(m_fileLoc_v);
00103     }
00104     // idx file not needed any more
00105     try {
00106         cmn_Path idxFile = fsc_GetRedunCopyDir(a_mediaKey)
00107                         + fsc_GetRedunCopyMedVolFile(a_mediaKey, a_volNum);
00108         log_DBG_m(dbg_DETAIL, "Removing file: " << idxFile);
00109         cmn_File::DeleteFile(idxFile);
00110     }
00111     catch (ivd_SysError &se) {
00112         log_DBG_m(dbg_DETAIL, "File removing failed: " << se.GetFriendly());
00113     }
00114 
00115     m_recallSetEnd = m_fileLoc_v.begin();
00116     m_recallSetBegin = m_fileLoc_v.begin();
00117     m_remainingSplitSize = CountVolumeSize();
00118 }
//============================================================================//

Here is the call graph for this function:

fsc_FLSPerVolume::~fsc_FLSPerVolume ( void   ) 

Definition at line 121 of file fsc_FLSPerVolume.cpp.

References log_FUNC_m.

00121                                         {
00122     log_FUNC_m(~fsc_FLSPerVolume);
00123 }


Member Function Documentation

void fsc_FLSPerVolume::Insert ( ivd_FileLocationData_t a_fileLoc  ) 

Impossible to inser new element after sort and cut.

Impossible to insert new element after sort and cut

Definition at line 126 of file fsc_FLSPerVolume.cpp.

References CountVolumeSize(), ie_NOT_SUPPORTED, log_FUNC_m, m_fileLoc_v, m_recallSetBegin, m_recallSetEnd, m_remainingSplitSize, and m_sorted.

00126                                                               {
00127     log_FUNC_m(Insert);
00128 
00130     if (m_sorted) {
00131         throw ivd_InternalError( ie_NOT_SUPPORTED,
00132             "Storage is already sorted an rearange. Items cannot be inserted any more.");
00133     }
00134     m_fileLoc_v.push_back(a_fileLoc);
00135     m_recallSetEnd = m_fileLoc_v.begin();
00136     m_recallSetBegin = m_fileLoc_v.begin();
00137     m_remainingSplitSize = CountVolumeSize();
00138 }

Here is the call graph for this function:

void fsc_FLSPerVolume::SortByOffset (  ) 

Definition at line 141 of file fsc_FLSPerVolume.cpp.

References DumpFileListVector(), FileLocDataOffsetCompare(), log_FUNC_m, m_fileLoc_v, m_recallSetBegin, and m_recallSetEnd.

Referenced by pm_RecallSetReader::pm_RecallSetReader(), and fsc_FLSPerMedia::SortList().

00141                                     {
00142     log_FUNC_m(SortByOffset);
00143     qsort(&m_fileLoc_v[0],
00144           m_fileLoc_v.size(),
00145           sizeof(ivd_FileLocationData_t),
00146           FileLocDataOffsetCompare);
00147     m_recallSetEnd = m_fileLoc_v.begin();
00148     m_recallSetBegin = m_fileLoc_v.begin();
00149     DumpFileListVector();
00150 }

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_FileLocationData_t_v_t& fsc_FLSPerVolume::GetRefOfFileLocDataVec (  )  [inline]

Definition at line 57 of file fsc_FLSPerVolume.h.

Referenced by i_EfficientRecallJob_i::PrepareFailedRecallListSeq(), and i_EfficientRecallJob_i::PrepareResource().

00057 { return  m_fileLoc_v; };               

Here is the caller graph for this function:

i_FileLocationDataList_t * fsc_FLSPerVolume::GetNextRecallList ( UInt64_t  a_buffSize  ) 

Definition at line 166 of file fsc_FLSPerVolume.cpp.

References ivd_FileLocationData_t::blockOffset, i_FileLocationData_t::blockOffset, dbg_DETAIL, ivd_FileLocationData_t::fileID, i_FileLocationData_t::fileID, HSM_FILE_HEADER_SIZE, log_DBG_m, log_FUNC_m, m_fileLoc_v, m_recallSetBegin, m_recallSetEnd, m_remainingSplitSize, MAX_READ_COUNT, ivd_FileLocationData_t::migrationID, i_FileLocationData_t::migrationID, i_FileLocationData_t::splitSize, and ivd_FileLocationData_t::splitSize.

Referenced by pm_RecallSetReader::GetNextRecallSet().

00166                                                                                  {
00167     log_FUNC_m(GetNextRecallList);
00168 
00169     UInt64_t fileSize = 0;
00170 
00171     m_recallSetBegin = m_recallSetEnd;
00172 
00173     i_FileLocationDataList_t_var fileLocDataList(new i_FileLocationDataList_t);
00174     UInt32_t numOfFiles(0);
00175 
00176     for (; m_recallSetEnd != m_fileLoc_v.end(); ++m_recallSetEnd ) {
00177         ivd_FileLocationData_t &fldSour = *m_recallSetEnd;
00178         UInt64_t toRead(0);
00179 
00180         toRead = fldSour.splitSize + HSM_FILE_HEADER_SIZE;
00181         if (   ( (fileSize + toRead) > a_buffSize)
00182             || ( numOfFiles >= MAX_READ_COUNT) ) {
00183             break;
00184         }
00185 
00186         // Dynamic resize(dont know vector size in advance)
00187         fileLocDataList->length(numOfFiles + 1);
00188 
00189         i_FileLocationData_t   &fldDest = fileLocDataList[numOfFiles];
00190 
00191         fldDest.fileID      = fldSour.fileID;
00192         fldDest.blockOffset = fldSour.blockOffset;
00193         fldDest.migrationID = fldSour.migrationID;
00194         fldDest.splitSize   = fldSour.splitSize;
00195 
00196         log_DBG_m(dbg_DETAIL, "FileID: " << fldDest.fileID
00197             << ", block off: " << fldDest.blockOffset
00198             << ", file size: " << fldDest.splitSize);
00199 
00200         fileSize += toRead;
00201         m_remainingSplitSize -= toRead;
00202         numOfFiles++;
00203     }
00204 
00205     log_DBG_m(dbg_DETAIL, "DiskBufferSize: " << a_buffSize
00206                        << " File size read: " << fileSize);
00207     log_DBG_m(dbg_DETAIL, "MAX_READ_COUNT: " << MAX_READ_COUNT
00208                        << " Number of files read: " << numOfFiles);
00209     return fileLocDataList._retn();
00210 }

Here is the caller graph for this function:

i_RecallList_t * fsc_FLSPerVolume::GetCurrentRecallList (  ) 

Definition at line 269 of file fsc_FLSPerVolume.cpp.

References dbg_DETAIL, ivd_FileLocationData_t::fileID, i_Recall_t::fileID, ivd_FileLocationData_t::fileIdx, i_Recall_t::fileIdx, i_Recall_t::fileSize, log_DBG_m, log_FUNC_m, m_recallSetBegin, m_recallSetEnd, ivd_FileLocationData_t::migrationID, and i_Recall_t::migrationID.

Referenced by pm_RecallSetReader::GetCurrentRecallSet().

00269                                                        {
00270     log_FUNC_m(GetCurrentRecallList);
00271 
00272     i_RecallList_t_var seqRecallList(new i_RecallList_t);
00273     ivd_FileLocationData_t_v_i iter = m_recallSetBegin;
00274 
00275     int i(0);
00276     for (; iter != m_recallSetEnd; ++iter) {
00277         ivd_FileLocationData_t &fldSour = *iter;
00278 
00279         // Dynamic resize(dont know sequence size in advance)
00280         seqRecallList->length(i + 1);
00281 
00282         i_Recall_t &recallStr = seqRecallList[i];
00283 
00284         recallStr.fileID      = fldSour.fileID;
00285         recallStr.migrationID = fldSour.migrationID;
00286         // Get Copies set it to split size.
00287         // HSM set it to file size to be checked in FSC. Not checked if 0.
00288         recallStr.fileSize    = 0;
00289         recallStr.fileIdx     = fldSour.fileIdx;
00290         i++;
00291     }
00292 
00293     log_DBG_m(dbg_DETAIL, "Number of files in list: " << i);
00294     return seqRecallList._retn();
00295 }

Here is the caller graph for this function:

UInt64_t fsc_FLSPerVolume::GetCurrentSplitSize (  ) 

Definition at line 153 of file fsc_FLSPerVolume.cpp.

References dbg_LOW, HSM_FILE_HEADER_SIZE, log_DBG_m, log_FUNC_m, m_fileLoc_v, m_recallSetEnd, and ivd_FileLocationData_t::splitSize.

Referenced by pm_RecallSetReader::GetCurrentSplitSize().

00153                                                {
00154     log_FUNC_m(GetCurrentSplitSize);
00155 
00156     if (m_recallSetEnd != m_fileLoc_v.end()) {
00157         ivd_FileLocationData_t &currentSplit = *m_recallSetEnd;
00158         log_DBG_m(dbg_LOW, "Current split size: " << currentSplit.splitSize);
00159 
00160         return currentSplit.splitSize + HSM_FILE_HEADER_SIZE;
00161     }
00162     return 0;
00163 }

Here is the caller graph for this function:

UInt64_t fsc_FLSPerVolume::GetRemainingBytesToCopy (  ) 

Definition at line 229 of file fsc_FLSPerVolume.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, and m_remainingSplitSize.

Referenced by pm_RecallSetReader::GetRemainingBytesToCopy().

00229                                                    {
00230     log_FUNC_m(GetRemainingBytesToCopy);
00231 
00232     log_DBG_m(dbg_DETAIL, "m_remeaningSplitSize: " << m_remainingSplitSize);
00233 
00234     return m_remainingSplitSize;
00235 }

Here is the caller graph for this function:

bool fsc_FLSPerVolume::AtEndOfList (  )  [inline]

Definition at line 62 of file fsc_FLSPerVolume.h.

Referenced by pm_RecallSetReader::EndOfCurrentVolume().

00062 { return (m_recallSetEnd == m_fileLoc_v.end()); };

Here is the caller graph for this function:

ivd_MedVolNum_t fsc_FLSPerVolume::GetVolNum (  )  [inline]

Definition at line 64 of file fsc_FLSPerVolume.h.

Referenced by fsc_FLSPerMedia::GetNextFSLPerVolume().

00064 { return m_volNum; };

Here is the caller graph for this function:

void fsc_FLSPerVolume::DumpFileListVector (  ) 

Definition at line 238 of file fsc_FLSPerVolume.cpp.

References log_FUNC_m, and m_fileLoc_v.

Referenced by DumpFileListVector(), and SortByOffset().

00238                                           {
00239     log_FUNC_m(DumpFileListVector);
00240 
00241     DumpFileListVector(m_fileLoc_v.begin(), m_fileLoc_v.end());
00242 }

Here is the caller graph for this function:

void fsc_FLSPerVolume::DumpFileListVector ( ivd_FileLocationData_t_v_i  a_begin,
ivd_FileLocationData_t_v_i  a_end 
)

Definition at line 245 of file fsc_FLSPerVolume.cpp.

References ivd_FileLocationData_t::blockOffset, dbg_DETAIL, DumpFileListVector(), ivd_FileLocationData_t::fileID, ivd_FileLocationData_t::fileIdx, log_DBG_m, log_FUNC_m, ivd_FileLocationData_t::migrationID, and ivd_FileLocationData_t::splitSize.

00246                                                                             {
00247     log_FUNC_m(DumpFileListVector);
00248 
00249     ivd_FileLocationData_t_v_i iter = a_begin;
00250 
00251     int numOfFiles(0);
00252 
00253     log_DBG_m(dbg_DETAIL, " === File list vector === ");
00254     for (; iter != a_end; ++iter) {
00255         ivd_FileLocationData_t &fld = *iter;
00256 
00257         log_DBG_m(dbg_DETAIL, "FileID: " << fld.fileID
00258             << ", block off: " << fld.blockOffset
00259             << ", file size: " << fld.splitSize
00260             << ", migration ID: " << fld.migrationID
00261             << ", fileIdx: " << fld.fileIdx);
00262         numOfFiles++;
00263     }
00264     log_DBG_m(dbg_DETAIL, " Total: "  << numOfFiles << " files");
00265     log_DBG_m(dbg_DETAIL," ========================= ");
00266 }

Here is the call graph for this function:

UInt64_t fsc_FLSPerVolume::CountVolumeSize (  )  [private]

Definition at line 213 of file fsc_FLSPerVolume.cpp.

References dbg_DETAIL, HSM_FILE_HEADER_SIZE, log_DBG_m, log_FUNC_m, and m_fileLoc_v.

Referenced by fsc_FLSPerVolume(), and Insert().

00213                                            {
00214     log_FUNC_m(CountVolumeSize);
00215 
00216     UInt64_t volumeSize(0);
00217     ivd_FileLocationData_t_v_i iter;
00218 
00219     for (iter = m_fileLoc_v.begin(); iter != m_fileLoc_v.end(); iter++ ) {
00220         volumeSize += (iter->splitSize + HSM_FILE_HEADER_SIZE);
00221     }
00222 
00223     log_DBG_m(dbg_DETAIL, "Volume size: " << volumeSize);
00224 
00225     return volumeSize;
00226 }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 69 of file fsc_FLSPerVolume.h.

Definition at line 70 of file fsc_FLSPerVolume.h.

Definition at line 77 of file fsc_FLSPerVolume.h.

Referenced by Insert().


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

Generated on Mon Feb 27 19:20:46 2012 for OPENARCHIVE by  doxygen 1.5.6